procgen  Check-in [ab1b71a07a]

Overview
Comment:updates
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ab1b71a07a2839ce1f66394f20d03eee8f9f4c4ea84ae46e88fb421f2d0b63be
User & Date: lexi on 2020-10-17 06:26:30
Other Links: manifest | tags
Context
2021-08-29
17:08
$100 will make me extremely more racist check-in: ca1d956dff user: lexi tags: trunk
2020-10-17
06:26
updates check-in: ab1b71a07a user: lexi tags: trunk
2020-10-15
08:07
updates check-in: c572c01910 user: lexi tags: trunk
Changes

Modified monster.ml from [a6081fd51c] to [dce9a8bc7b].

     2      2   	"verve"; "pulchritude"; "beneficence"; "dismay"; "wit";
     3      3   	"cheer"; "glee"; "malevolence"; "wickedness"; "cruelty";
     4      4   	"sagacity"; "splendor"; "pride"; "rage"; "fury"; "snazz";
     5      5   	"foolishness"; "sleepiness"; "curiosity"; "brevity"; "lust";
     6      6   	"confidence"; "bashfulness"; "awkwardness"; "terror";
     7      7   	"accuracy"; "insanity"; "sorrow"; "gladness"; "weariness";
     8      8   	"depression"; "passion"; "dread"; "popularity"; "vulgarity";
     9         -    "madness"; "compassion"; "tact";
            9  +    "madness"; "compassion"; "tact"; "evil"; "hate"; "hatred";
           10  +    "horror"; "omnipotence"; "charisma"; "radiance"; "depravity";
    10     11   |]
    11         -let mods = [|
           12  +let mods_w = [|
    12     13   	"filled"; "overcome"; "shining"; "vivacious";
    13     14   	"burning"; "blazing"; "morose"; "gleeful"; "mad";
    14     15   	"shaking"; "howling"; "snarling"; "gruesome";
    15     16       "helpless"; "vibrant"; "desperate"; "triumphant";
    16         -    "glum"; "sorrowful"; "struck";
           17  +    "glum"; "sorrowful"; "struck"; "grumbling";
           18  +    "griping"; "hissing"; "hooting"; "crackling";
           19  +    "glowing"; "radiant";
           20  +|]
           21  +let mods_f = [|
           22  +    "full of"; "struck by"; "overcome by";
    17     23   |]
           24  +let mods = Array.append (Array.map (fun a -> a ^ " with") mods_w) mods_f
    18     25   let advs = [|
    19     26   	"cruelly"; "angrily"; "madly"; "hopelessly"; "thoughtlessly";
    20     27   	"wickedly"; "hopefully"; "quickly"; "speedily"; "furiously";
    21     28   	"kindly"; "maniacally"; "tearfully"; "bashfully"; "angrily";
    22     29   	"wondrously"; "splendidly"; "tremendously"; "badly";
    23     30   	"terribly"; "foolishly"; "snazzily"; "toplessly"; "balefully";
    24     31   	"beautifully"; "kindly"; "thoughtfully"; "cautiously";
    25         -    "severely"; "wisely"; "lustfully"; "tactfully";
           32  +    "severely"; "wisely"; "lustfully"; "tactfully"; "winsomely";
           33  +    "watchfully"; "irresponsibly"; "headlessly"; "charismatically";
           34  +    "radiantly"; "sinfully"; "lawlessly"; "unlawfully"; "lawfully";
    26     35   |]
    27     36   let adjs = [|
    28     37   	"cheerful"; "wondrous"; "overwhelming"; "adorable";
    29     38   	"snazzy"; "hopeful"; "desperate"; "lustful"; "dour";
    30     39   	"sad"; "sorrowful"; "hopeless"; "all-consuming"; "mad";
    31     40   	"cruel"; "dreadful"; "terrible"; "fearsome"; "inescapable";
    32     41   	"thoughtless"; "vile"; "bashful"; "topless"; "naked"; "dire";
    33     42   	"baleful"; "vulgar"; "beautiful"; "horrid"; "cautious";
    34         -    "violent"; "wise"; "supreme"; "marvelous"; "tactful";
           43  +    "violent"; "wise"; "supreme"; "marvelous"; "tactful"; "evil";
           44  +    "wretched"; "fearful"; "awe-inspiring"; "vengeful"; "wrathful";
           45  +    "omnipotent"; "charismatic"; "radiant"; "lawless"; "unlawful";
           46  +    "lawful";
    35     47   |]
    36         -let verbs = [|
           48  +
           49  +type rule = R of string array | S of string | B of rule list | A of rule array | O of rule;;
           50  +let mkb = Array.map (fun a -> S a)
           51  +let verbs = Array.append (mkb [|
    37     52   	"shines"; "toots"; "honks"; "mutters"; "whispers"; "growls";
    38     53   	"roars"; "whuffles"; "warbles"; "howls"; "screams"; "shrieks";
    39     54   	"quivers"; "dances"; "hops up and down"; "grins"; "mumbles";
    40     55   	"counsels you"; "glares"; "stares at you"; "looks up"; "gazes at you";
    41     56       "marvels"; "laughs"; "sins"; "whistles"; "whungles"; "jangles";
    42     57       "twerks"; "blinks"; "blorps"; "flunks"; "planks"; "glitters";
    43     58       "gleams"; "grumbles"; "grouches"; "bites you"; "gnaws on you";
    44     59       "glimmers"; "gripes"; "plots"; "wonders"; "whittles"; "plays the fiddle";
    45     60       "ponders"; "contemplates you"; "scrunches"; "zaps"; "zaps you";
           61  +    "hoots"; "crackles"; "glows"; "blogs";
           62  +|]) [|
           63  +    B[S"radiates "; R nouns];
           64  +    B[S"oozes "; R nouns];
    46     65   |]
    47     66   
    48     67   let pick a = a.(Random.int (Array.length a))
    49         -type rule = R of string array | S of string | B of rule list | A of rule array | O of rule;;
    50     68   let rec eval r : string = match r with
    51     69   	| R x -> pick x
    52     70   	| S x -> x
    53     71   	| B x -> List.fold_left (^) "" (List.map eval x)
    54     72   	| A x -> eval (pick x)
    55     73   	| O x -> if Random.int 2 = 0 then eval x else ""
    56     74   let syl () =
................................................................................
    63     81   	let obs = A [| stop; fric; vstop; nasal; liq; |] in
    64     82   	let v = R [| "a"; "e"; "u"; "o"; "i"; "ee"; "oo"; "au"; "ai";"oi";|] in
    65     83   	let sr = A [|
    66     84   		B[obs; v; O obs];
    67     85   		B[A [|stop;vstop;fric;vfric;|]; O liq; v; O obs];
    68     86   	|] in eval sr
    69     87   	;;
    70         -let prefixes = [| "ur-"; "dire "; "dire ur-"; "super "; "ultra "; "great "; "grand "; "terror-"; "horror-"; "giant "; "evil "; "dark ";|]
           88  +let prefixes = [| "ur-"; "dire "; "dire ur-"; "super "; "ultra "; "great "; "grand "; "terror-"; "horror-"; "giant "; "evil "; "dark "; "vorpal "; "royal ";|]
    71     89   let name () =
    72     90   	let size = 1 + (Random.int 3) in
    73     91   	let rec loop n acc = if n = 0 then acc else loop (n-1) (acc^(syl ())) in
    74     92   	(if Random.int 2 = 0 then (pick prefixes) else "") ^ loop size "";;
    75     93   
    76     94   let isvowel c = match c with
    77     95   	| 'a' | 'e' | 'i' | 'o' | 'u' -> true
................................................................................
    90    108   		"egads!";
    91    109   		"how wondrous!";
    92    110   		"how marvelous!";
    93    111   		"how gruesome!";
    94    112   		"how splendid!";
    95    113   		"oh no!";
    96    114   	|] in
    97         -	let kinds = B [
          115  +    let kinds =
          116  +        let maybe x = O(B[x; S" "]) in
          117  +        let adjp = B[maybe (R advs); R adjs] in B [
    98    118   			R [|"it";"she";"he";|]; S" ";
    99    119   			A [|
   100         -				B[ R verbs; S " ";
          120  +				B[A verbs; S " ";
   101    121   					A [|
   102         -						B[ S "with "; O(B[R adjs; S" "]); R nouns;];
          122  +                        B[ S "with "; maybe adjp; R nouns;];
   103    123   						R advs;
   104    124   					|];
   105    125   				];
   106         -				B[S"is "; O(B[R advs;S " ";]); R mods;
   107         -					O(B[ S " with "; O(B[R adjs; S" "]); R nouns;]);
          126  +				B[S"is "; maybe (R advs);
          127  +                    A [|
          128  +                        B[R mods; S" "; maybe adjp; R nouns;];
          129  +                        R mods_w;
          130  +                    |]
   108    131   				];
   109    132   			|];
   110    133   			S "!"; 
   111    134   	] in
   112    135   	(pick msgs)^" "^(indef (name()))^"! " ^ (eval kinds);;
   113    136   	
   114    137   let rec times n a = if n = 0 then () else (a (); times (n-1) a);;
   115    138   let () = Random.self_init (); 
   116    139   (*	times 20 (fun () ->*)
   117    140   		print_string ((encounter ()) ^ "\n")
   118    141   (*	)*)