procgen  Check-in [1521429541]

Overview
Comment:initial commit
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 15214295416bc1eda60fb8df4f67a01d45372acb35569bb11451225c9ac82f7a
User & Date: lexi on 2018-09-24 23:18:14
Other Links: manifest | tags
Context
2018-11-11
10:19
add ransul check-in: 9a711d8a06 user: lexi tags: trunk
2018-09-24
23:18
initial commit check-in: 1521429541 user: lexi tags: trunk
23:14
initial empty check-in check-in: bbb86f3bf6 user: lexi tags: trunk
Changes

Added argue.ml version [de71563f83].

            1  +type node = L of string | R of node array | C of string array | B of node list | O of node | F of (unit -> node)
            2  +let punct = C[|
            3  +	"."; ",";
            4  +	"?"; " ?"; "??"; " ??"; " ? ?";
            5  +	"!"; " !"; "!!"; " !!"; " ! !";
            6  +	"…"; "..."; ". . . "; "...!";
            7  +	"!?"; " !?"; " ! ?"; " <3"; " ♥";
            8  +	"~"; " ~uwu~"; " XD"; " :D";
            9  +	" :P"; " ;)"; " :)"; " :("; 
           10  +	" ಠ_ಠ"; " ^_^"; " >_>";
           11  +	" >_<";
           12  +|]
           13  +let dimin = C [|
           14  +	"hon";
           15  +	"honey";
           16  +	"honeybunch";
           17  +	"dear";
           18  +	"dearie";
           19  +	"my dear";
           20  +	"sweetie";
           21  +	"sweetheart";
           22  +	"bro";
           23  +	"babe";
           24  +	"dude";
           25  +	"bruh";
           26  +	"my man";
           27  +	"sweetcheeks";
           28  +	"kiddo";
           29  +	"kid";
           30  +	"daddy";
           31  +	"folks";
           32  +	"girl";
           33  +	"my child";
           34  +	"my sweet summer child";
           35  +	"pumpkin";
           36  +	"punkin";
           37  +	"my boy";
           38  +	"little boy";
           39  +	"little girl";
           40  +	"punk";
           41  +	"bb";
           42  +	"genius";
           43  +	"cuck";
           44  +	"bitch";
           45  +	"buddy";
           46  +	"bud";
           47  +	"pal";
           48  +	"silly";
           49  +	"silly boy";
           50  +	"dummy";
           51  +|]
           52  +let writers = C[|
           53  +	(* miscellaneous assholes & multipurpose tools *)
           54  +	"lacan"; "derrida"; "chomsky"; "nietzsche"; "baudrillard"; "beaudrillard"; 
           55  +	"freud"; "pinker"; "žižek"; "zizek"; "foucault"; "deleuze"; "delueze"; "kant"; "hume";
           56  +	"russell"; "russel"; "descartes"; "guattari"; "guatari"; "richelieu"; "hegel"; "heidegger";
           57  +	"de tocqueville"; "de toqueville"; "friedman"; "keynes"; "hobbes"; "bacon"; "avicenna";
           58  +	"schopenhauer"; "camus"; "hamilton"; "schwarzenegger"; "rousseau"; "rawls"; "goethe";
           59  +	"hobbes"; "friedman"; "fromm"; "hubbard"; "johnson";
           60  +	(* greeks *)
           61  +	"plato"; "aristotle"; "socrates"; "aristophanes"; "democritus";
           62  +	(* commies *)
           63  +	"trotsky"; "comrade trotsky"; "lenin"; "comrade lenin"; "mao"; "marx";
           64  +	"hoxha";
           65  +	(* there are a lot of ways to misspell that man's name *)
           66  +	"kierkegaard"; "kierkegard"; "keirkegaard"; "keirkegard";
           67  +	(* names i just made up*)
           68  +	"o'dair"; "wilson"; "saint-madeleine"; "sampson-crusoe"; "lambert"; "hernández";
           69  +	"duchamp"; "roberts"; "michaud"; "bägelstein"; "braustwitz"; "lawrence"; "smith";
           70  +	(* elvish word generator *)
           71  +	"harviorha"; "vieluval"; "beceou"; "ilvëthiorá"; "lioralie"; "bainon"; "alherdor";
           72  +	"lenusá";
           73  +	(* fictional characters *)
           74  +	"dracula"; "voight-kampff"; "bond"; "thranduil"; "hood";
           75  +	(* me *)
           76  +	"hale";
           77  +|]
           78  +let interj = C [|
           79  +	"wow";
           80  +	"w o w";
           81  +	"lmao";
           82  +	"lmfao";
           83  +	"rofl";
           84  +	"no";
           85  +	"nope";
           86  +	"wrong";
           87  +	"nuh-uh";
           88  +	"lol";
           89  +	"haha";
           90  +	"um";
           91  +	"k";
           92  +	"okay";
           93  +	"ok";
           94  +	"amazing";
           95  +	"alright";
           96  +	"now";
           97  +	"jesus";
           98  +	"oh boy";
           99  +	"boy";
          100  +	"man";
          101  +	"oh man";
          102  +	"oh my";
          103  +	"oh god";
          104  +	"god";
          105  +	"oh wow";
          106  +	"oh my sweet summer child";
          107  +	"my sweet summer child";
          108  +	"yo";
          109  +	"but";
          110  +	"so";
          111  +	"no way";
          112  +	"fake";
          113  +	"holy shit";
          114  +	"holy crap";
          115  +	"what the fuck";
          116  +	"ugh";
          117  +	"ughhh";
          118  +	"ugghh";
          119  +	"uugh";
          120  +	"yuck";
          121  +	"ew";
          122  +	"gross";
          123  +	"try and keep up";
          124  +|]
          125  +let disagreements = C[|
          126  +	"well";
          127  +	"well maybe";
          128  +	"well, maybe";
          129  +	"well, no";
          130  +	"well, actually";
          131  +	"well actually";
          132  +	"okay well";
          133  +	"actually";
          134  +	"maybe";
          135  +	"but";
          136  +	"and";
          137  +	"so";
          138  +	"first off";
          139  +	"firstly";
          140  +	"okay so first off";
          141  +	"okay well firstly";
          142  +|]
          143  +let chance i = (Random.int i) = 0
          144  +let pick (r : 'a array) : 'a = r.(Random.int(Array.length r))
          145  +let quote x = F(fun () -> if chance 30 then R[|
          146  +	B[L"\""; x ;L"\""];
          147  +	B[L"“"; x ;L"”";];
          148  +|] else x)
          149  +type word = A of string | An of string
          150  +let rude_adjs = [|
          151  +	A "smelly"; A "gross"; A "far-right"; A "right-wing";
          152  +	A "whiny"; A "childish"; A "stupid"; A "thoughtless";
          153  +	A "worthless"; An "inane";  An "idiotic"; A "fucking";
          154  +	A "fuckin"; A "pissy"; A "dumbfuck"; A "thick";
          155  +	A "sad"; A "pathetic"; A "witless"; A"horny";
          156  +	A "useless"; An "irrational";
          157  +|]
          158  +let rude_nouns = [|
          159  +	A "dumbass"; An "asshole"; A "jerk"; A "dipshit";
          160  +	A "baby"; A "nazi"; A "chucklefuck"; A "pig";
          161  +	An "ass"; A "dork"; A "geek"; A "nerd"; A "loser";
          162  +	A "whiner"; A "wanker"; A "gobshite"; A "wingnut";
          163  +	A "boob"; A "fuck"; A "fucker"; A "cuck"; A "yokel";
          164  +	A "feeb"; A "thug"; A"gringo";
          165  +|]
          166  +let makeinsult () = let adj = if chance 2 then Some(pick rude_adjs) else None in
          167  +	let noun = pick rude_nouns in L(match adj, noun with
          168  +		| None, A(n) -> "a " ^ n
          169  +		| None, An(n) -> "an " ^ n
          170  +		| Some(A(a)), A(n) 
          171  +		| Some(A(a)), An(n) -> "a " ^ a ^ " " ^ n
          172  +		| Some(An(a)), A(n) 
          173  +		| Some(An(a)), An(n) -> "an " ^ a ^ " " ^ n);;
          174  +		
          175  +let starters = R[| interj; interj; disagreements; |]
          176  +let byes = C[| "thanks"; "thx"; "kthx"; "kthxbye"; "bye"; "bye now"; "goodbye"; "bye-bye"; "byeee"; "byeeee"; "love you too"; "byebye"; "pls and thx"; "please and thanks"; "please and thank you"; "okay"; "have a nice day"; "goodnight"; "if you know what i mean";|]
          177  +let closers = R[| byes; dimin; B[byes; O(punct); L" "; dimin;];|]
          178  +let ewe = C[| "you"; "u"; "you"; "u"; "you"; "u"; "you"; "u"; "you're";|]
          179  +let yore = R[| L"your"; L"you're"; L"ur"; L"yr"; L"u're"; B[ewe; L" are"]; B[ewe; L" r"];|]
          180  +let pleez = C[|"please"; "pls"; "plz";|]
          181  +let poscmds = R[|
          182  +	L "grow up";
          183  +	L "learn to read";
          184  +	B[L "listen to "; yore; O(L " "); L "self"];
          185  +	B[L "calm "; yore; R[|
          186  +		B[O(L " "); L "self"; O(L" down")];
          187  +		L" tits";
          188  +	|]];
          189  +	L"calm down";
          190  +	L"calm dowm";
          191  +	B[L "use "; yore; L " brain"];
          192  +	B[C[|"read"; "listen to"|]; L" what "; yore; C[|" sayin"; " saying"|]];
          193  +	B[L "think before "; ewe; L " speak"];
          194  +	L "try again";
          195  +	L "try harder";
          196  +	L "explain";
          197  +	B[L "explain "; yore; O(L " "); L "self"];
          198  +	B[L "explain "; yore; L " reasoning"];
          199  +	B[L "explain "; yore; L " logic"];
          200  +	B[L "explain "; yore; L " evidence"];
          201  +	B[L "show me "; yore; L " evidence"];
          202  +	L "go away";
          203  +	L "check the bible";
          204  +	L "pay attention";
          205  +	B[L "learn "; yore; L " place"];
          206  +	L "shut up";
          207  +	L "shut the fuck up";
          208  +	L "stop talking";
          209  +	L "shut your mouth";
          210  +	L "answer my question";
          211  +	L "read a book";
          212  +	B[L "read "; O(L"some "); writers];
          213  +	B[L "read "; O(L"some "); writers];
          214  +	B[L "read "; O(L"some "); writers];
          215  +	L "go to hell";
          216  +	L "burn in hell";
          217  +	L "go to jail";
          218  +	L "notice me senpai";
          219  +	B[L "stop contradicting "; yore; O(L " "); L "self"];
          220  +	L "alert the presses";
          221  +	L "get a job";
          222  +	L "learn to take a joke";
          223  +	L "stop projecting";
          224  +	L "speak english";
          225  +	L "face facts";
          226  +	L "pay me";
          227  +	L "die in a fire";
          228  +	B[L"stop being "; F makeinsult;];
          229  +	B[L"stop being such "; F makeinsult;];
          230  +	B[L"quit being "; F makeinsult;];
          231  +	B[C[|"learn ";"lern ";"lrn "|]; O(L"how "); C[|"to ";"2 ";"too ";"two "; "";|]; C[|"spell";"spel";"spele";"speling";"spelling"|]];
          232  +|]
          233  +let negcmds = R [|
          234  +	B[L"be "; F makeinsult;];
          235  +	B[L"be such "; F makeinsult;];
          236  +	B[L"act like such "; F makeinsult;];
          237  +	B[L"keep acting like such "; F makeinsult;];
          238  +	B[L"make "; F makeinsult; L " of "; yore; O(L " "); L "self"];
          239  +	B[L"make such "; F makeinsult; L " of "; yore; O(L " "); L "self"];
          240  +	L"be that way";
          241  +	L"talk like that";
          242  +	L"keep whining";
          243  +	L"whine";
          244  +	
          245  +|]
          246  +let commands = R[|
          247  +	poscmds;
          248  +	poscmds;
          249  +	poscmds;
          250  +	B[C[|"don't "; "dont "|]; negcmds];
          251  +|]
          252  +let thats = C[| "that is"; "that's"; "it's"; "it is";|]
          253  +let thathas = C[| "that has"; "that's"; "it has"; "it has";|]
          254  +let thatsnot = C[| "that isn't"; "that's not"; "it's not"; "it isn't"; "that is not"; "it is not";|]
          255  +let theirs = C[| "there is"; "there's"; "theirs"; "their's"; |]
          256  +let thathasnt = C[| "that hasn't"; "that's not"; "it's not"; "it hasn't"; "that has not"; "it has not";|]
          257  +let im = C[| "i'm"; "i am"; "I am"; "i'm"; "im"; "Im"; |]
          258  +let comments = R [|
          259  +	L "cool story"; 
          260  +	L "fuck me";
          261  +	L "fuck you";
          262  +	B[thats; L " wrong"];
          263  +	B[thats; L " not even wrong"];
          264  +	B[thats; L " so wrong"];
          265  +	B[thatsnot; L " correct"];
          266  +	B[thatsnot; L " right"];
          267  +	B[thats; L " incorrect"];
          268  +	B[thats; L " untrue"];
          269  +	B[thatsnot; L " true"];
          270  +	B[ewe; L " are wrong"];
          271  +	B[thats; L " never been true"];
          272  +	B[thathas; L " never been true"];
          273  +	B[thathasnt; L " ever been true"];
          274  +	B[ewe; L " have no evidence"];
          275  +	B[ewe; L " can't prove it"];
          276  +	B[ewe; L " can't prove that"];
          277  +	L "bored now";
          278  +	L "checkmate, atheists";
          279  +	L "i'm not really into pokemon";
          280  +	L "whatever";
          281  +	B[ O(L"how "); L"are "; ewe; O(L" even"); L" real" ];
          282  +	B[L"are "; ewe; O(L" even"); L" a person" ];
          283  +	B[L"are "; ewe; L" a bot" ];
          284  +	B[L"i think "; yore; O(L" actually"); O(L" just"); L" a bot"];
          285  +	L "you need jesus";
          286  +	L "you need Jesus";
          287  +	L "you need you some jesus";
          288  +	B[O(B[yore; L" "]); L"so edgy"];
          289  +	L "real edgy";
          290  +	B[thats; L" nice"];
          291  +	B[thats; O(L" so"); L" fake"];
          292  +	B[thats; L" cool"];
          293  +	B[L"good for "; ewe];
          294  +	B[O(L "watch out "); L "we got a";C[|" real ";"n "|]; L"edgelord here"];
          295  +	B[L "are "; ewe; C[|
          296  +		" okay";
          297  +		" alright";
          298  +		" well";
          299  +		" diseased";
          300  +		" sick";
          301  +		" ok";
          302  +		" OK";
          303  +	|]];
          304  +	B[L "do "; ewe; L" need help"];
          305  +	B[L "no "; ewe];
          306  +	B[O(L "it "); L"takes one to know one"];
          307  +	B[L"where do i even start"; O(B[L" with"; R[|ewe;L" this one"; L" this bullshit"|]])];
          308  +	B[im; L" not "; C[|"gonna";"going to"|]; C[|" repeat myself"; " say it again"|];];
          309  +	L"i won't repeat myself";
          310  +	L"i won't repeat myself again";
          311  +	L"i won't say it again";
          312  +	L"don't make me repeat myself";
          313  +	B[ewe; L" make me laugh"];
          314  +	B[ewe; L" are very funny"];
          315  +	B[ewe; L" should be a comedian"];
          316  +	B[yore; L" very funny"];
          317  +	B[yore; L" a terrible person"];
          318  +	B[yore; L" a terrible person, aren't "; ewe];
          319  +	B[yore; L" a terrible human being"];
          320  +	B[yore; L" a terrible excuse for human being, aren't "; ewe];
          321  +	B[O(L"and "); C[|"who";"what"|]; O(L" even"); L" are ";ewe;O(L" supposed to be")];
          322  +	B[L"delete ";yore;L" account"];
          323  +	B[L"who do ";ewe;L" think ";ewe;L" are";];
          324  +	B[L"what are ";ewe; O(L" even"); L" talking about"];
          325  +	B[ewe; L" mad"];
          326  +	L"umadbro";
          327  +	B[L"do "; ewe; O(L" actually"); O(L" even"); L" know what that word means"];
          328  +	L"blocked and reported";
          329  +	B[L"what are ";ewe; O(L" even"); C[|" on"; " smoking"|]];
          330  +	B[L"do ";ewe; O(L" even"); L" lift"];
          331  +	B[L"are ";ewe; O(L", like,"); L" high"; O(L" or something")];
          332  +	L"look who's Mad Online";
          333  +	B[L"are ";ewe; O(L" seriously"); L" Mad Online"; O(L " right now")];
          334  +	B[L"i like ";ewe];
          335  +	L"wait for it";
          336  +	B[ewe; L " still haven't answered my question"];
          337  +	B[yore; L " an idiot"];
          338  +	B[L "i will pray for "; ewe];
          339  +	L"let's do this";
          340  +	L"fight me irl";
          341  +	L"come at me";
          342  +	B[L"how can you ";ewe;
          343  +		C[| " say "; " think "; " believe " |];
          344  +		C[| "that"; "those things"; "such a thing";
          345  +		"something like that"; "things like that"; "lies"; "bullshit";|];
          346  +	];
          347  +	B[im; L" so sad for "; ewe];
          348  +	L"send nudes";
          349  +	L"jesus loves you";
          350  +	B[im; L" entitled to my opinion"];
          351  +	B[L "have "; ewe; L" even heard of the first amendment"];
          352  +	B[thats; L" called free speech"];
          353  +	L"a/s/l";
          354  +	B[L "do "; ewe; L" kik"];
          355  +	B[thats; L " hot"];
          356  +	B[ewe; L " have a conflict of interest"];
          357  +	B[L "why should i listen to "; ewe];
          358  +	B[yore; L " going to hell"];
          359  +	B[yore; L " going to go to hell"];
          360  +	B[theirs; L" a special place in hell for "; O(L"people like "); ewe];
          361  +	B[L"do "; ewe; O(L" even"); L" know who i am" ];
          362  +	B[L"it's like "; ewe; L" don't"; O(L" even"); L" know who i am" ];
          363  +	B[im; L" trying to remove it"];
          364  +	B[L "do "; ewe; L" need a safe space"];
          365  +	B[thats; L" just my opinion"];
          366  +	L"then what";
          367  +	L"seriously";
          368  +	B[L "how do "; ewe; L" know"; R[| L""; L" that"; B[L" "; thats; L " true";]|]];
          369  +	B[thats; L" circular reasoning"];
          370  +	L"https://yourlogicalfallacyis.com/bandwagon";
          371  +	L"https://yourlogicalfallacyis.com/appeal-to-authority";
          372  +	L"https://yourlogicalfallacyis.com/slippery-slope";
          373  +	L"https://yourlogicalfallacyis.com/strawman";
          374  +	L"https://yourlogicalfallacyis.com/ad-hominem";
          375  +	L"https://yourlogicalfallacyis.com/no-true-scotsman";
          376  +	L"https://yourlogicalfallacyis.com/personal-incredulity";
          377  +	L"https://yourlogicalfallacyis.com/begging-the-question";
          378  +	B[thats; L" a fallacy"];
          379  +	B[thats; L" incoherent"];
          380  +	B[thats; L" illogical"];
          381  +	B[thats; L" self-contradictory"];
          382  +	B[ewe; L" just said it wasn't"];
          383  +	B[ewe; L" just said that wasn't true"];
          384  +	B[L"now "; yore; L" just lying"];
          385  +	L"that makes no sense";
          386  +	L"what";
          387  +	L"wait back up";
          388  +	L"hold on";
          389  +	B[L"hold ";yore;L" horses"];
          390  +	B[yore; L" contradicting yourself"; O(L" again")];
          391  +	B[L "how old are "; ewe; O(L" really"); O(L" even")];
          392  +	B[O(L"i think "); yore; O(L" being"); L" intellectually dishonest"; O(L" again")];
          393  +	B[ewe; L " don't "; O(L"really "); O(L"even "); L"know what "; C[|"that word means";"those words mean";"words mean"|]; O(B[L", do ";ewe])];
          394  +	B[O(L"why do "); ewe; L" hate america"];
          395  +	B[O(L"someone "); L"alert the presses"];
          396  +	B[C[|"gravity";"evolution";"abortion";"atheism";"feminism";"misandry"|]; L" is "; O(L"still "); C[|"just";"only";"nothing but"|]; L" a theory";];
          397  +	B[yore; L" parents must be "; O(L"very "); C[|"proud of ";"ashamed of ";"angry at ";"sad for "|]; ewe];
          398  +	B[L"are "; ewe; L" being sarcastic"];
          399  +	B[L"are "; ewe; L" for real"];
          400  +	B[L"are "; ewe; L" actually serious"];
          401  +	B[L"no wonder "; ewe; L" don't have a girlfriend"];
          402  +	B[L"no wonder "; ewe; L" dont have a girlfriend"];
          403  +	B[L"no wonder "; ewe; L" haven't got a girlfriend"];
          404  +	B[L"can't "; ewe; C[|""; " people"; " all"; "ppl"|]; O(L " ever"); O(L " even"); O(L " just"); O(L " learn to"); L" take a joke"];
          405  +	B[L"can't take a joke can "; ewe];
          406  +	B[L"can't take a joke, can "; ewe];
          407  +	B[L"can't take a joke, can we"];
          408  +	B[yore; O(L " so"); L" mad"];
          409  +	B[im; O(L " so"); L" mad"];
          410  +	B[L"are ";ewe;L" projecting"];
          411  +	B[L"i think ";yore;L" projecting"];
          412  +	L"tits or gtfo";
          413  +	L"gtfo";
          414  +	B[thats; L" illegal"];
          415  +	B[thats; L" illegal"];
          416  +	B[thatsnot; L" legal"];
          417  +	B[thatsnot; L" lawful"];
          418  +	B[thats; L" problematic"; O(B[O(L","); L" for a couple reasons";]) ];
          419  +	L"so what";
          420  +	L"i don't care";
          421  +	L"i dont care";
          422  +	L"why should i care";
          423  +	B[
          424  +		R [|
          425  +			B[L"all "; yore; L" doing is"];
          426  +			B[yore; C[|"";" only";" just"|]];
          427  +		|];
          428  +		L" embarassing "; yore;
          429  +		R[|
          430  +			B[O(L " "); L "self"];
          431  +			B[O(L " own"); L " dumb ass"];
          432  +		|]
          433  +	];
          434  +	B[ewe; L" know i don't care, right"];
          435  +	B[L"i can't believe "; ewe; L" actually went there"];
          436  +	B[thats; L" a sin"];
          437  +	B[yore; L " sick"];
          438  +	L"time for some game theory";
          439  +	L"time 4 some game theory";
          440  +	B[
          441  +		O(B[O(L "maybe "); ewe; L"should "]); L"shut "; O(L"the fuck "); L "up";
          442  +		O(B[L" while "; C[|
          443  +			"other people ";
          444  +			"the adults ";
          445  +			"the grown-ups ";
          446  +			"smarter people ";
          447  +			"better people ";
          448  +			"the smart people ";
          449  +			|]; L"are talking";])
          450  +	];
          451  +	B[L"are "; ewe; L" always "; R[|
          452  +		B[L"this "; C[|
          453  +			"dense";
          454  +			"thick";
          455  +			"slow";
          456  +			"stupid";
          457  +			"annoying";
          458  +			"angry";
          459  +			"useless";
          460  +			"much of a cuck";
          461  +			"much of an asshole";
          462  +			"irritating";
          463  +			"irrational";
          464  +			"illogical";
          465  +			"dumb";
          466  +			"horny";
          467  +		|]];
          468  +		B[O(L"such "); C[|
          469  +			"a cuck";
          470  +			"a honkey";
          471  +			"a gringo";
          472  +			"a baby";
          473  +			"a pansy";
          474  +			"a loser";
          475  +			"an idiot";
          476  +			"an asshole";
          477  +			"a yokel";
          478  +			"a dumbfuck yokel";
          479  +			"an asshat";
          480  +			"a dumbfuck honkey";
          481  +			"a dumbfuck yokel asshat";
          482  +			"a piece of shit";
          483  +			"a turd";
          484  +			"a party-pooper";
          485  +			"a wanker";
          486  +			"a burden";
          487  +			"a hindrance";
          488  +			"an obstacle";
          489  +		|]];
          490  +	|]];
          491  +	B[ewe; L" have to tell me if "; yore; L" a bot"; O(B[O(punct); L" it's the law"])];
          492  +	L "this is america";
          493  +	B[thats; O(L" called"); L " a power move"];
          494  +	L "i can't even";
          495  +	L "i cant even";
          496  +	L "don't know, don't care";
          497  +	B[L "are "; ewe; L" "; O(L"actually "); O(L"just ");
          498  +		C[|"trying to"; "tryin to"; "tryna"|]; L" ";
          499  +		C[|"bore";"whine";"wheedle";"bitch";"cry"|]; L " me ";
          500  +		C[|"to death";"into submission"|]; O(L" or something")
          501  +	];
          502  +	B[C[|"its";"it's"|]; L" time for some game theory"];
          503  +|]
          504  +
          505  +let insist = R[|
          506  +	B[ewe; L " need to"];
          507  +	L"try and";
          508  +	R[|
          509  +		L"do us a favor and";
          510  +		L"do us all a favor and";
          511  +		L"do us both a favor and";
          512  +		L"do everyone a favor and";
          513  +		L"do the world a favor and";
          514  +		L"do me a favor and";
          515  +		B[L "do "; yore; O(L " "); L "self a favor and"];
          516  +	|];
          517  +	L"try &";
          518  +	B[ewe; O(L" really"); L " gotta"];
          519  +	B[ewe; O(L" really"); L " should"];
          520  +	B[L "can "; ewe];
          521  +	B[L "why don't "; ewe];
          522  +	B[L "why dont "; ewe];
          523  +	B[L "y dont "; ewe];
          524  +	L "time to";
          525  +	B[L"time for ";ewe;L" to"];
          526  +	L "fuck you";
          527  +	L "fuck you,";
          528  +|]
          529  +let advs = O(O(C[|"";" already";" next time";" again";|]))
          530  +let insults = R[|
          531  +	commands;
          532  +	B[C[|"please "; "pls "; "plz "; ""|]; insist; L" "; quote poscmds; advs];
          533  +	B[insist; C[|" please "; " pls "; " plz "; " "|]; quote commands; advs];
          534  +	B[insist; L" "; quote poscmds; advs; C[|" please"; " pls"; " plz"; ""|];];
          535  +	B[
          536  +		C[|"pls 2 "; "lern2"|];
          537  +		quote poscmds;
          538  +	];
          539  +	B[O(B[ewe; L" "]); L"better "; quote poscmds;];
          540  +	B[O(B[ewe; L" "]); L"better not "; quote negcmds;];
          541  +	B[
          542  +		C[|"fine"; "okay"; "sure"; "whatever"; "w/e"; "k"; "ok"|]; O(punct); L " ";
          543  +		negcmds; O(punct);
          544  +		L " see if i care"; O(punct);
          545  +	]
          546  +|]
          547  +let rec realgrammar =  R [|
          548  +		B[starters; punct];
          549  +		B[starters; L ", "; quote dimin; punct];
          550  +		B[O(B[starters; L" ";]); insults; O(B[L ", "; quote dimin]); punct];
          551  +		B[O(B[starters; L" ";]); insults; O(B[L ", "; quote dimin]); punct];
          552  +		B[O(B[starters; L" ";]); insults; O(B[L ", "; quote dimin]); punct];
          553  +		B[O(B[interj; punct; L" ";]); quote comments; O(punct); O(B[L" ";closers])];
          554  +		(* extremely leftist voice *) B[
          555  +			O(B[starters; O(punct); L" "]);
          556  +			R[|
          557  +				B[L "have "; ewe; O(L" ever"); O(L" even"); L" read ";
          558  +					C[|"any ";"any ";"any ";"a single word of ";"";"";"";"";|];
          559  +					writers; O(L" at all")];
          560  +				B[
          561  +					C[|"i don't think"; "i don't believe"; "i doubt"; "doubt"; "really doubt"; "really gotta doubt"|];
          562  +					C[|" that ";" if "; " "|];
          563  +					ewe;
          564  +					O(L" have");
          565  +					O(L " even"); L" read "; C[|"any ";"any ";"any ";"a single word of ";"";"";"";"";|]; writers
          566  +				];
          567  +				B[L"maybe if ";ewe;C[|"";"'d";" had"|];L" read "; writers; L " you wouldn't be "; O(L"such "); F makeinsult;];
          568  +			|];
          569  +			O(B[O(L","); L" "; quote dimin]);
          570  +			O(punct);
          571  +		]
          572  +|]
          573  +let grammar = F (fun () -> match Random.int 32 with
          574  +	| 0 -> B[
          575  +		C[|
          576  +			"okay so (1/";
          577  +			"well first off (1/";
          578  +			"so (1/";
          579  +			"alright so (1/";
          580  +		|];
          581  +		F(fun () -> L(string_of_int ((Random.int 200)+53))); L")"];
          582  +	| 1 -> B[L"\""; realgrammar; L"\""];
          583  +	| 2 -> B[L"“"; realgrammar; L"”"];
          584  +	| 3 | 4 -> B[L"*"; yore;];
          585  +	| _ -> realgrammar);; (* this is horrific *)
          586  +
          587  +let iter c fn = 
          588  +	let rec loop i = fn i; if i = c-1 then () else loop (i+1) in loop 0
          589  +let titcase x = 
          590  +	let len = String.length x in
          591  +	let buf = Bytes.of_string x in
          592  +	iter len (fun i ->
          593  +		if i = 0 then
          594  +			let c = Bytes.get buf (i) in
          595  +			if c <= 'z' && c >= 'a' then
          596  +				Bytes.set buf (i) (char_of_int ((int_of_char c)-32)) else ()
          597  +		else if i != len-1 && (Bytes.get buf i = ' ' || Bytes.get buf i = '*') then
          598  +			let c = Bytes.get buf (i+1) in
          599  +			if c <= 'z' && c >= 'a' then
          600  +				Bytes.set buf (i+1) (char_of_int ((int_of_char c)-32)) else ();
          601  +			else ();
          602  +	);
          603  +	Bytes.to_string buf;;
          604  +	
          605  +let randcap x = match Random.int 6 with
          606  +	| 0 -> String.uppercase_ascii x
          607  +	| 1 -> titcase x
          608  +	| _ -> x
          609  +let rec eval : node -> string = function
          610  +	| L(s) -> s
          611  +	| R(n) -> eval (pick n)
          612  +	| B(l) -> List.fold_left (fun x y -> x ^ (eval y)) "" l
          613  +	| C(a) -> pick a
          614  +	| O(n) -> if chance 2 then (eval n) else ""
          615  +	| F(f) -> eval (f ())
          616  +let () = Random.self_init ();
          617  +	print_string (randcap (eval grammar))

Added badbiobot.ml version [3931f272bd].

            1  +type node = N of node list | S of string | R of node array | Many of node * int * string | P | O of node | Filter of (string->string) * node;;
            2  +let gclass = R[|S"Warrior"; S "Bard"; S "Ranger"; S "Wizard"; S "Mage"; S "Paladin"; S "Rogue"; S "Ninja"; S "Warlock"; S "Champion"; S "Barbarian"; S "Assassin"; S "Conjurer"; S "Summoner"; S "Fighter"; S "Berserker"; S "Druid"; S "Orc"; S "Goblin"|]
            3  +let name = R [|
            4  +	S "Stalin"; S "Hitler"; S "Marx"; S "Kony"; S "Mao"; S "Mussolini"; S "Trump"; S "Ted Cruz"; S "esr"; S "Richard Dawkins"; S "Mishima"; S "Nixon"; S "Kissinger"; S "Reagan"; S "Erdogan"; S "Hillary"; S "Clinton"; S "Bernie"; S "Sanders"; S "David Cameron"; S "Thatcher"; S "Nigel Farage"; S "McCarthy"; S "Putin"; S "Frank Underwood"; S "Andrew Jackson"; S "Sam Harris"; S "Christopher Hitchens"; S "Columbus"; S "Julian Assange"; S "Marcus Cicero"; S "Caligula"; S "Nero"; S "Commodus"; S "Caracalla"; S "Constantine"; S "Atilla the Hun"; S "Glenn Greenwald"; S "Ed Balls"; S "Edward Snowden"; S "Genghis Khan";
            5  +|]
            6  +let nomen = R [| S"nationalist"; S "capitalist"; S "Libertarian"; S "atheist"; S "conservative"; S "Marxist"; S "beta"; S "rationalist"; S "Republican"; S "Neoreactionary"; S "communist"; S "moe"; S "NRx"; S "racial realist"; S "hacktivist"; S "European"; S "European-American"; S "white separatist"; S "Anonymous"; S "heterosexual"; S "intellectual"; S "moderate"; S "sapiosexual"; S "intellectual"; S "egalitarian";|]
            7  +let adj = R [|nomen; S "circumgender"; S "transracial"; S "free-thinking"; S "incel"; S "proud"; S "rational"; S "straight"; S "opinionated"; S "politically active"; S "traditional"; S "pro-life"; S "angry"; S "white"|]
            8  +let band = R[|S"Metallica"; S "Nine Inch Nails"; S "Taylor Swift"; S "Drake"; S "Run The Jewels"; S "Daft Punk"; S "Amanda Palmer"; S "Coldplay"; S "Radiohead";|]
            9  +let trendy_food = R [| S "bacon"; S "vodka"; S "beer"; S "wine"; S "coffee"; S "whiskey"; S "Soylent"; S "steak"; S "kale"; |]
           10  +let lang = R [| S "Ruby"; S "Rails"; S "Python"; S "Scala"; S "Java"; S "PHP"; S "Haskell"; S "LISP"; S "JavaScript"; S "node.js"; S "React"; S "Backbone"; S "Polymer"; S "Ember"; S "Angular"; S ".NET"; S "C#"; S "F#"; S "Visual Basic .NET"; S "PowerShell"; S "Meteor.js"; S "jQuery"; S "Linux"; S "GNU/Linux"; S "UNIX"; S "AWK"; S "bash"; S "zsh"; S "fish"; S "GNU"; S "Open Source "; S "Erlang"; S "Docker"; S "R"; S "Hadoop"; S "Android"; S "iOS"; S "Unity"; S "Unreal Engine"; S "UE4"; S "Source Engine"; S "Apache"; S "Lua"; S "Prolog"; S "C++"; S "D"; S "Go"; S "Golang"; S "Rust"; S "Nim"; S "OCaml"; S "Kotlin"; S "Clojure"; S "Groovy"; S "Scheme"; S "Common Lisp"; S "llvm"; S "LLVM"; S "Hoon"; S "Urbit"; S "Nock"; S "Elixir"; S "Crystal"; S "TypeScript"; S "PureScript"; S "CoffeeScript"; S "Elm"; S "LaTeX"; S "troff"; S "groff"; S "Markdown"; S "HTML"; S "CSS"; S "XSLT"; S "Flash"; S "ColdFusion"; S "FORTRAN"; S "COBOL"; S "Matlab"; S "Mathematica"; S "CUDA"; S "OpenCL"; S "OpenGL"; S "DirectX"; S "Vulkan"; S "Pascal"; S "Perl"; S "Perl 6"; S "UX"; S "Emacs Lisp"; S "Vimscript"; S "AppleScript"; S "Swift"; S "Objective-C"; S "Cocoa"; S "Cocoa Touch"; S "Xamarin"; S "Qt"; S "GTK+"; S "WPF"; S "JavaFX"; S "Swing"; S "Smalltalk" |]
           11  +let dev = R[|N[lang; S " developer";];  N[lang; S " evangelist";]; N[lang; S " dev";]; N[lang; S " lover";]; N[lang; S " enthusiast";]; N[lang; S " professional";]; N[lang; S " expert";]; N[lang; S " "; gclass]; N[lang; S " connoisseur";];|]
           12  +let rec activity = R [|band; trendy_food; S"freedom"; S "free speech"; S"nationalism"; S "Minecraft"; S "Call of Duty"; S "partying"; S "beer pong"; S "football"; S "baseball"; S "vaping"; S "pussy"; S "bacon"; S "LessWrong"; S "America"; S "RationalWiki"; S "memes"; S "4chan"; S "8chan"; S "comics"; S "hacktivism"; S "hacking"; S "ComicCon"; S "cosplay"; S "Game of Thrones"; S "hentai"; S "advocacy"; N[noun; S " advocacy";]; S "sex"; S "science"; S "anime"; S "Big Data"; S "Cloud"; S "butts"; S "UKIP"; S "white separatism"; S "Brexit"; S "grammar"; S "free software"; S "open source"; S "real literature";|]
           13  +and noun = R [|
           14  +	nomen; S "Christian"; S "brony"; S "bro"; S "brogrammer"; S "brocialist"; N[activity; S "evangelist"]; N [S "bro"; noun]; dev; N[S "10x "; lang; S " dev";]; S "free-thinker"; S "Redditor"; S "atheist"; S "furry"; S "victim of cisphobia"; S "male feminist"; S "equalist"; S "MRA"; S "beer drinker"; S "father"; S "blogger"; N[noun; S "blogger";]; S "Thatcherite"; S "geek"; S "thought leader"; S "antivax"; S "channer"; S "Men's Rights Activist"; N[S "Social Justice "; gclass]; N[activity; S "lover";]; S "Anonymous"; S "infosec professional"; S "BernieBro"; S "Marxist"; S "socialist"; S "journalist"; S "marketer"; S "social media analyst"; S "philosopher"; S "educator"; S "advocate"; N[activity; S " advocate"]; S "sexpert"; S "professional"; N[activity; S" expert";]; N[activity; S"ninja";]; S "Pythonista"; S "Rubyist"; S "PhD candidate"; S "cartoonist"; S "man"; S "skeptic"; S "grammar Nazi"; S "open sorcerer"; S "podcaster"; N[name; S "-wannabe"]; S "lover"; S "detective"; S "trekkie"; S "fuckboy"; S "Soylent eater";
           15  +|]
           16  +let political_party = R[|
           17  +S "Green"; S "Labour"; S "Labor"; S "National"; S "Libertarian"; S "Democratic"; S "Republican"; S "Liberal Democrat"; S "Lib Dem"; S "Tory"; S "Conservative"; S "Liberal"; S "UKIP"; S "BNP"; S "SSP"; S "Britain First"; S "Pirate"; S "Sex"; S "Communist";
           18  +|]
           19  +let minority = R [| S "gays"; S "homosexuals"; S "jews"; S "Arabs"; S "Mexicans"; S "Muslims"; S "immigrants"; S "blacks"; S "transgendereds"; S "transgenders"; S "transgenderists"; S "queers"; S "SJWs"; S "feminists"; S "indie game developers"; S "gamers"; S "homos"; |];;
           20  +let minority_kind = R [|S "gender"; S "justice"; S "trans"; S "feminism"; S "queer"; S "gay"; S "homosexual";|]
           21  +
           22  +let startup = R[|S "Fumblr"; S "Grumblr"; S "Humblr"; S "Appearancely"; S "AccidentNow"; S "RefuseNow"; S "remainr"; S "Trembleit"; S "Punish"; S "SprayNow"; S "Tennisr"; S "Traply"; S "Yawnin"; S "momly"; S "Smartyell"; S "radiatein"; S "sawly"; S "suffery"; S "Sceneify"; S "WomanNow"; S "Ballhub"; S "Systemme"; S "Earnify"; S "Mathit"; S "Gruntly"; S "Bongh.it"; S "Lyly"|];;
           23  +let hashtag = R [|
           24  +	S "#BlueLivesMatter";
           25  +	S "#AllLivesMatter";
           26  +	S "#NotAllMen";
           27  +	S "#KONY2012";
           28  +	S "#GamerGate";
           29  +	S "#FeelTheBern";
           30  +	S "#ImWithHer";
           31  +	S "#BuildTheWall";
           32  +	S "#VoteLeave";
           33  +	S "#FreeWeev";
           34  +	S "#WhiteGenocide";
           35  +	S "#2Ad";
           36  +	S "#NordicModel";
           37  +|]
           38  +let verb = R [| S "game"; S "code"; S "blog"; S "hack"; S "vape pussy" |]
           39  +let startup_position = R[|S "CEO"; S "CTO"; S "Soylent eater"; S "Dev"; S "$dev"; S "Product Manager"; S "Customer Success Manager"; S "Full Stack Engineer"; S "Data journalist"; S "Infosec Expert"; S "Designer"; S "UX"; S "Hacker"; S "Engineer"; S "VP of Engineering"; S "Data scientist"; S "Growth Hacker"; S "Marketing"; S "Sexpert"|]
           40  +let sportsball_team = R[|S "Ducks"; S "Beavers"; S "Steelers"; S "Lakers"; S "Blazers"; S "Redskins"; S "Clippers"; S "All Blacks"; S "Newcastle"; S "Cubs"; S "West Ham"; S "Man U"; S "Chelsea"; S "Liverpool"|]
           41  +let activity = R [| band; trendy_food; S "Minecraft"; S "Call of Duty"; S "partying"; S "beer pong"; S "football"; S "baseball"; S "vaping"; S "pussy"; S "bacon"; S "LessWrong"; S "America"; S "RationalWiki"; S "memes"; S "4chan"; S "8chan"; S "comics"; S "hacktivism"; S "hacking"; S "ComicCon"; S "cosplay"; S "Game of Thrones"; S "hentai"; S "advocacy"; N[noun; S " advocacy";]; S "sex"; S "science"; S "anime"; S "Big Data"; S "Cloud"; S "Butts"; S "UKIP"; S "white separatism"; S "Brexit"; S "grammar"; S "free software"; S "open source"; S "real literature"; S "Star Trek"; S "Star Wars"; |]
           42  +let rec activity_phrase = N[activity; O(N[S", "; activity_phrase])]
           43  +
           44  +let phrase = R [|
           45  +	N[S "Husband, father, "; noun; P;];
           46  +	S "Friendly.";
           47  +	S "Hubby.";
           48  +	S "That is all.";
           49  +	S "Not as funny as I think I am.";
           50  +	S "Nice guy.";
           51  +	S "You have been warned.";
           52  +	N[S "Avatar by "; name; S ".";];
           53  +	S "Jet fuel can't melt steel beams.";
           54  +	N[minority; S " can't melt steel beams.";];
           55  +	N[activity; S " can't melt steel beams.";];
           56  +	N[lang; S " can't melt steel beams.";];
           57  +	N[name; S " was right.";];
           58  +	S "Ally.";
           59  +	S "Cynical bastard.";
           60  +	S "Proud Ally.";
           61  +	S "Don't follow if you're easily offended.";
           62  +	S "I aim to offend.";
           63  +	S "Sarcastic.";
           64  +	S "TERF is a slur.";
           65  +	S "Put the Christ back in Christmas.";
           66  +	S "Give me liberty or give me death.";
           67  +	S "Fights for the users.";
           68  +	S "I call them like I see them.";
           69  +	S "I calls 'em like I sees 'em.";
           70  +	S "Honest.";
           71  +	S "I fear I am now a victim of 'cisphobia'.";
           72  +	N[O(N[Many(adj,1," "); S " "]); noun; P;];
           73  +	N[O(N[Many(adj,1," "); S " "]); S "#"; noun; P;];
           74  +	N[adj; P;];
           75  +	N[Many(adj,3," "); S " #"; noun; S " and proud of it"; P;];
           76  +	N[activity_phrase; P];
           77  +	S "No fatties.";
           78  +	N[minority_kind; S " critical."];
           79  +	N[minority_kind; S "-critical."];
           80  +	N[minority_kind; S " separatist.";];
           81  +	N[S "Go "; sportsball_team; S "!";];
           82  +	S "Don't tread on me.";
           83  +	S "English only.";
           84  +	S "We are all Africans.";
           85  +	S "Je suis Charlie.";
           86  +	N[S "Je suis "; name; P;];
           87  +	N[S "I am "; name; P;];
           88  +	N[S "We are all "; name; P];
           89  +	N[minority; S " are the real oppressors.";];
           90  +	N[minority; S " are the real racists.";];
           91  +	N[S "My best friends are "; minority; P;];
           92  +	N[S "Lover of all things "; lang; P;];
           93  +	N[S "Lover of all things "; activity; P;];
           94  +	S "RTs are not endorsements.";
           95  +	S "Thoughts are my own.";
           96  +	N[S "CEO of "; startup;];
           97  +	N[startup_position; S " at "; startup; P; ];
           98  +	S "Opinions are my own.";
           99  +	S "Opinions do not reflect those of my employer.";
          100  +	N[adj; S " pride.";];
          101  +	N[noun; S " pride.";];
          102  +	N[S "I like "; activity; P;];
          103  +	N[S "I stand with "; name; S ".";];
          104  +	S "I speak truth to power.";
          105  +	S "History will vindicate me.";
          106  +	S "Make America great again.";
          107  +	N[S "Co-founder of "; startup; P];
          108  +	S "Molon labe.";
          109  +	S "Μολών λαβέ.";
          110  +	S "The best cure for bad speech is more speech.";
          111  +	N[S "I "; verb; P;];
          112  +	N[S "I "; verb; S " and I vote.";];
          113  +	S "My public key: https://keyface.ohno/f897b10a.";
          114  +	N[S "Make America "; adj; S " again.";];
          115  +	S "Watch my TED Talk.";
          116  +	N[minority; S " need not apply.";];
          117  +	N[S "((("; name; S ")))";];
          118  +	N[S "Fan of "; band; P;];
          119  +	S "Beyhive.";
          120  +	S "He/him.";
          121  +	N[noun; S", "; noun; S ", "; noun; S ", not necessarily in that order.";];
          122  +	N[minority; S " are what's wrong with America.";];
          123  +	N[minority; S " go home.";];
          124  +	N[trendy_food; S " addict.";];
          125  +	N[trendy_food; S " enthusiast.";];
          126  +	N[trendy_food; S " and "; trendy_food; S ".";];
          127  +	N[Many(trendy_food,2,", "); S " and "; trendy_food; S ".";];
          128  +	N[trendy_food; S " is what's wrong with America.";];
          129  +	S "14/88.";
          130  +	S "No trigger warnings.";
          131  +	S "Resistance is futile.";
          132  +	N[political_party; S " shill.";];
          133  +	N[political_party; S " activist.";];
          134  +	N[S "Vote "; political_party; S "!";];
          135  +	N[name; S " for president!";];
          136  +	N[name; S " for America.";];
          137  +	S "I love correcting people who are wrong.";
          138  +	S "Carthago delenda est.";
          139  +	S "Don't @ me.";
          140  +	S "Just say no.";
          141  +	S "PM me for direct sales.";
          142  +	
          143  +|];;
          144  +let top = N[ Many(Filter(String.capitalize_ascii,phrase),2," "); O(N[S " "; Many(hashtag,1," ")]);]
          145  +let range min max = (Random.int (max-min)) + min
          146  +let pick (r: 'a array) : 'a = r.(range 0 (Array.length r));;
          147  +let rec copy n times sep : string = match times with
          148  +	| 0 -> eval n
          149  +	| _ -> (eval n)^sep^(copy n (times-1) sep)
          150  +and eval (n:node) : string = match n with
          151  +	| N l -> List.fold_left (^) "" (List.map eval l)
          152  +	| S s -> s
          153  +	| R r -> eval (pick r)
          154  +	| P -> "."
          155  +	| Many(n,t,s) -> let times = t+(range 0 2) in copy n times s
          156  +	| O x -> if Random.int 2 = 1 then eval x else ""
          157  +	| Filter(fn,n) -> fn (eval n);;
          158  +
          159  +let (^^) text chr = text ^ (String.make 1 chr)
          160  +let scramble text =
          161  +	let len = String.length text in
          162  +	let rec loop i acc tps =
          163  +		if i=len then acc else
          164  +		if i+1=len then acc^^text.[i] else
          165  +			match text.[i], text.[i+1] with
          166  +				| ' ', _ -> loop (i+1) (acc^" ") false
          167  +				| _ as c, ' ' -> loop (i+1) (acc^^c) false
          168  +				| c1, c2 -> if not tps && Random.int 3 = 0 then
          169  +					loop (i+2) ((acc^^c2)^^c1) true
          170  +				else
          171  +					loop (i+2) ((acc^^c1)^^c2) tps
          172  +	in loop 0 "" false
          173  +	
          174  +let () = Random.self_init(); print_string (scramble (eval top))

Added badname.c version [ad45f5162b].

            1  +// badname.c
            2  +// generates awful fantasy names based on a consistent
            3  +// lexicon.
            4  +// copyright 2014 alexis hale. released under GPLv2.
            5  +
            6  +#include <stdio.h>
            7  +#include <stdlib.h>
            8  +#include <time.h>
            9  +
           10  +#define to(ty, ctr, end) for(ty ctr = 0; ctr<end; ++ctr)
           11  +
           12  +typedef unsigned char u8;
           13  +
           14  +struct morpheme {
           15  +	const char* nat;
           16  +	const char* translation;
           17  +};
           18  +
           19  +struct morpheme nouns[] = {
           20  +	{"Ilu", "Stone"},     {"Siri", "Water"},  {"Raswa", "Skull"},
           21  +	{"Nishra", "Spleen"}, {"Olbu", "Blood"},  {"Oblu", "Rot"},
           22  +	{"Bolu", "Weed"},     {"Huru", "Face"},   {"Pere", "Dirt"},
           23  +	{"Sarwa", "Filth"},   {"Oru", "Land"},    {"Barna", "Stomach-"},
           24  +	{"Orba", "Gut"},      {"Pata", "Chair"},  {"U", "Self"},
           25  +	{"Ra", "Offal-"},     {"Batu", "Table-"}, {"Topa", "Scarf"},
           26  +	{"Bosi", "Cow"},      {"Sama", "Horse"},  {"Dopu", "Pig"},
           27  +	{"Lakta", "River"},   {"Lakta", "Mine"},  {"Fri", "Witch"},
           28  +	{"Tole", "Spell"},    {"Daba", "Book"},   {"Ipa", "Ale"},
           29  +	{"Odu", "Mead"},      {"Shiri", "Wine"},  {"Shospu", "Beer"},
           30  +	{"Kili", "Scream"},   {"She", "Loud"},    {"Ro", "Quick"},
           31  +	{"Tifti", "Foul"},    {"Wosa", "Evil"},   {"Bilka", "Poison-"},
           32  +	{"Swa", "Man"},       {"Pesta", "Frog"},  {"Tokta", "Bile"},
           33  +	{"Ke", "Weasel-"},     {"Poru", "Coal"},   {"Wokme", "Lie-"},
           34  +        {"Ortu", "Gold"},     {"Vaksa", "Fuck"},  {"Ruktu", "Hard"},
           35  +	{"Gorwa", "Shaft"},   {"Badga", "Rod"},   {"Ulwa", "Cock"},
           36  +	{"Vatra", "Fire"},
           37  +}, acts[] = {
           38  +	{"ktor", "splitter"}, {"swil", "cleaver"},   {"tfas", "burster"}, 
           39  +	{"dosk", "mangler"},  {"stot", "corruptor"}, {"brak", "grinder"},
           40  +	{"vas", "seeker"},    {"ftir", "drinker"},   {"var", "stamper"},
           41  +	{"shirk", "smeller"}, {"svis", "thief"},     {"brot", "seller"},
           42  +	{"tolt", "crosser"},  {"kdash", "burner"},   {"pris", "sailor"},
           43  +	{"ksat", "speaker"},  {"bkis", "carrier"},   {"shvor", "slayer"},
           44  +	{"klis", "avenger"},  {"ftam", "spoiler"},   {"lwar", "deceiver"},
           45  +	{"shpok", "grasper"}, {"pash", "striker"},   {"pris", "render"},
           46  +	{"prash", "shredder"},{"vask", "defiler"},   {"dar", "dweller"},
           47  +	{"vtir", "burner"},   {"bilk", "poisoner"},  {"vkaft", "poisoner"},
           48  +	{"ktaft", "pounder"}, {"rpift", "strangler"},{"ltaft", "rider"},
           49  +	{"kvat", "liar"},     {"ktik", "finder"},    {"vkas", "fucker"},
           50  +        {"bagde", "rod"},     {"gorwe", "shaft"},    {"kruk", "squeezer"},
           51  +	{"lwe", "cock"},      {"vakse", "fuck"},
           52  +
           53  +};
           54  +typedef struct name_t {
           55  +	struct morpheme* noun,* act;
           56  +} name_t;
           57  +
           58  +void prt(const char* c) {
           59  +	do putchar(*c); while (*(++c)!=0);
           60  +}
           61  +
           62  +void pname(name_t* names, u8 len) {
           63  +	u8 ct = 0;
           64  +	name_t* n = names;
           65  +	prt("\e[1m");
           66  +	do { 
           67  +		prt(n->noun->nat);
           68  +		prt(n++->act->nat);
           69  +		putchar(' ');
           70  +	} while (++ct < len);
           71  +	prt("\e[0m(\"\e[4m");
           72  +	ct = 0;
           73  +	do { 
           74  +		prt(names->noun->translation);
           75  +		prt(names++->act->translation);
           76  +		if (ct != len-1) putchar(' ');
           77  +	} while (++ct < len);
           78  +	prt("\e[0m\")");
           79  +}
           80  +
           81  +typedef struct entity_t {
           82  +	name_t* names; u8 namec;
           83  +} entity_t;
           84  +
           85  +void make_entity(entity_t* e) {
           86  +	e -> namec=rand()%3 + 2;
           87  +	e -> names=malloc(sizeof(name_t)*e->namec);
           88  +	to (u8, i, e -> namec) {
           89  +		e -> names[i].noun =
           90  +			&nouns[rand() % sizeof(nouns) / sizeof(struct morpheme)];
           91  +		e -> names[i].act =
           92  +			&acts[rand() % sizeof(acts) / sizeof(struct morpheme)];
           93  +	}
           94  +}
           95  +
           96  +int main() {
           97  +	srand(time(NULL));
           98  +	const u8 entities = 20;
           99  +	entity_t* es = malloc(sizeof(entity_t)*entities);
          100  +	for (u8 e = 0; e<entities; e++)
          101  +		make_entity(&es[e]),
          102  +		pname(es[e].names, es[e].namec), putchar('\n');
          103  +	return 0;
          104  +}

Added botsoc.scm version [6437b613b4].

            1  +; (include "lib/lisp-macro.scm")
            2  +(include "lib/bot-gambit.scm")
            3  +
            4  +(rule (base-ideology)
            5  +	("liberalism")		("socialism")		("capitalism")
            6  +	("anarchism")		("marxism")		("marxism-leninism")
            7  +	("nazism")			("feminism")		("stalinism")
            8  +	("democracy")		("stirnerism")		("harm reduction")
            9  +	("egoism")			("objectivism")	("monarchism")
           10  +	("tribadism")		("eugenics")		("fascism")
           11  +	("juche")			("nationalism")	("human extinctionism")
           12  +	("demonology")	("linguistics")		("voluntary human extinction")
           13  +	("onanism")		("anthropology") ("authoritarianism")
           14  +	("totalitarianism")	("social justice")	("identity politics")
           15  +	("idpol")				("terrorism")		("islamism")
           16  +	("hedonism")		("libertinism")		("computer science")
           17  +	("libertarianism")	("static typing")	("dynamic typing"))
           18  +(rule (ideology-prefix)
           19  +	("neo-")		("social ")	("democratic ")
           20  +	("paleo-")	("retro-")	("anarcho-")
           21  +	("femino-")	("neo")		("anti-")
           22  +	("sado-")	("eroto-")	("strangulo-")
           23  +	("theo-")	("ultra-")	("arachno-")
           24  +	("anti")		("post-") 	("post")
           25  +	("ethno-")	("marxism-") ("left-")
           26  +	("alt-")	("right-") ("space ") ("gay ")
           27  +	("quantum "))
           28  +(rule (ideology)
           29  +	((base-ideology))
           30  +	((adjective) " " (ideology))
           31  +	((ideology-prefix) (base-ideology)))
           32  +(rule (problem)
           33  +	("poverty")		("hunger")			("hatred")
           34  +	("racism")		("mortality")		("misogyny")
           35  +	("drug use")	("alcoholism")		("homophobia")
           36  +	("addiction")	("exploitation")	("drug prohibition")
           37  +	("nazism")		("class conflict")	("harm reduction")
           38  +	("biphobia")	("lesbianism")		("the opioid crisis")
           39  +	("Russia")		("masturbation")	("nuclear war")
           40  +	("oppression")	("immigration")	("totalitarianism")
           41  +	("depression")	("mental illness")	("war")
           42  +	("disease") 		("the bourgeoisie")
           43  +	("crime")		("activism")			("Noam Chomsky")
           44  +	("wealth")		("eugenics")		("bigotry")
           45  +	("genocide")	("bitcoin")			("ethnic cleansing")
           46  +	("vaccination")	("autism")			("the alt-right")
           47  +	("authoritarianism") ("freedom of speech")
           48  +	("tooth decay")	("neurodivergence")
           49  +	("abortion")	("healthcare")
           50  +	("islamophobia") ("sexting") ("static typing")
           51  +	("dynamic typing") ("heterophobia") ("heterosexuality"))
           52  +(rule (adjective)
           53  +	("racist")			("homophobic")	("misogynist")
           54  +	("bigoted")		("anti-" (thing))	("evil")
           55  +	("insane")		("impossible")		("contradictory")
           56  +	("illogical")		("revolutionary")	("self-contradictory")
           57  +	("white")		("communist")		("socialist")
           58  +	("marxist")		("stalinist")			("lesbian")
           59  +	("untested")	("neurotypical")	("anarchist")
           60  +	("religious")	("bourgeois")		("proletarian")
           61  +	("classist")		("monarchist")	("fascist")
           62  +	("postfurry")	("eugenicist")		("alt-right")
           63  +	("furry")			("problematic")	("totalitarian")
           64  +	("unlikely")		("compromised")	("authoritarian")
           65  +	("useless")		("useful")			("neurodivergent")
           66  +	("desirable")	("undesirable")	("dialectic")
           67  +	("undialectic")	("undefined")	("imperialist")
           68  +	("good")		("bad")			("colonialist")
           69  +	("acausal")		("black")		("statically-typed")
           70  +	("emergent")	("libertarian")	("unreconstructed")
           71  +	("teenage")		("Lacanian")	("intersectional"))
           72  +
           73  +(rule (trait)
           74  +	("power") ("influence") ("wealth") ("solidarity")
           75  +	("hope") ("conviction") ("autonomy") ("freedom")
           76  +	("liberty") ("faith"))
           77  +
           78  +(rule (necessity)
           79  +	("sex") ("water") ("food") ("money")
           80  +	("wealth") ("income") ("welfare") ("tea")
           81  +	("therapy") ("pain relief") ("medical care")
           82  +	("medicine") ("reproduction") ("hope") ("faith")
           83  +	("love"))
           84  +
           85  +(rule (thing)
           86  +	((problem)) ((necessity))	("Russia")	("Mars")
           87  +	("activism")
           88  +	((thing) " activism") ("anti-" (thing) " activism")
           89  +	((adjective) " activism") ("bitcoin") ("humanity")
           90  +	("vaccination") ("autism") ("medical care")
           91  +	((adjective) " power") ((adjective) " policy")
           92  +	((adjective) " politics")
           93  +	("transit") ("public transit") ("public transportation")
           94  +	("meth") ("heroin") ("dialectics") ("the dialectic")
           95  +	("the Discourse") ("medical care") ("psychiatry")
           96  +	("influenza") ("alien life") ("mind control")
           97  +	("terrorism") ("identity") ("healthcare")
           98  +	 ("literature") ("grass") ("catnip")
           99  +	("television") ("romance") ("finance") 
          100  +	("opium") ("law") ("dating") ("online dating") ("friendship"))
          101  +
          102  +(rule (things)
          103  +	("pandas")	("lasers")	("toasters")
          104  +	("kulaks")	("opiates") ("painkillers")
          105  +	("teacups")	("umbrellas") ((thing) " rights")
          106  +	((adjective) " rights")
          107  +	((thing) " activists") ("anti-" (adjective) " activists")
          108  +	((ideology) " activists") ((adjective) " activists")
          109  +	("humans") ("vaccines")
          110  +	("doctors") ("drugs") ("hospitals") ("UFOs") ("aliens")
          111  +	("flowers") ("pumpkins") ("guns") ("babies")
          112  +	("friends")
          113  +	)
          114  +(rule (thingss)
          115  +	((thing)) ((things)))
          116  +	
          117  +(rule (group)
          118  +	("gays")			("whites")			("African-Americans")	
          119  +	("the poor")	("the rich")			("Jewish people")
          120  +	("natives")		("otherkin")		("psychics")
          121  +	("furries")		("immigrants")	("trans people")
          122  +	("men")			("women")			("the bourgeoisie")
          123  +	("boys")			("girls")				("the proletariat")
          124  +	("activists")		("stirnerites")		("proletarians")
          125  +	("extremists")	((thing) " extremists") ((thing) " activists")
          126  +	("addicts")		("junkies")			("tweakers")
          127  +	("potheads")	("acid heads")		("meth addicts")
          128  +	("doctors")		("gamers")			("marijuana users")
          129  +	("dentists")		("fascists")			("marijuana addicts")
          130  +	("nazis")			("wizards")			("heroin addicts")
          131  +	("hackers")		("LSD addicts")	("disabled people")
          132  +	("criminals")	("teenagers")		("the differently-abled")
          133  +	("teens")		("cissexuals"))
          134  +	
          135  +; utility fns
          136  +(rule (adjfor adj con g)
          137  +	(adj)
          138  +	(adj con g))
          139  +(rule (modal)
          140  +	("will") ("could") ("might") ("will likely") ("can")
          141  +	("surely will")	("undoubtedly will") ("may"))
          142  +	
          143  +(rule (modal-not)
          144  +	("will not") ("could not") ("might not") ("will likely not") ("cannot")
          145  +	("surely will not")	("undoubtedly will not") ("may not"))
          146  +
          147  +(rule (modal-rnd) ((modal)) ((modal-not)))
          148  +
          149  +(rule (cause-provoke)
          150  +	("cause")		("lead to")	("provoke the development of")	
          151  +	("provoke")	("promote")	("create"))
          152  +(rule (causes-provokes)
          153  +	("causes")		("leads to")	("provokes the development of")		
          154  +	("provokes")	("promotes")	("creates"))
          155  +	
          156  +(rule (cause g i)
          157  +	(g " " (modal))
          158  +	((thing) " " (modal) " cause " g " to")
          159  +	(i " " (modal) " cause " g " to"))
          160  +
          161  +; rule definitions
          162  +(rule (predicate-or-claim i)
          163  +		(i " is actually " (ideology))
          164  +		(i " is not " (ideology))
          165  +		(i " disproves " (ideology))
          166  +		(i " is disproven by " (ideology))
          167  +		(i " is a fundamentally " (adjective) " ideology")
          168  +
          169  +		(i " is " (adjective))
          170  +		(i " is basically " (adjective))
          171  +		(i " is essentially " (adjective))
          172  +		(i " is unavoidably " (adjective))
          173  +		(i " is fundamentally " (ideology))
          174  +		
          175  +		(i " is bad for " (group))
          176  +		(i " is good for " (group))
          177  +		
          178  +		(i " seeks to eradicate " (group))
          179  +		(i " seeks to eradicate " (problem))
          180  +
          181  +		(i " is the source of " (problem))
          182  +		(i " is the cause of " (problem))
          183  +		(i " is the the reason for " (problem))
          184  +		(i " is the the reason " (group) " suffer from " (problem))
          185  +
          186  +		(i " excludes " (group))
          187  +		((cause (group) i) " be excluded from " (thing))
          188  +		(i " dehumanizes " (group))
          189  +		(i " alienates " (group))
          190  +		(i " marginalizes " (group))
          191  +		
          192  +		(i " pathologizes " (problem))
          193  +		(i " pathologizes " (thingss))
          194  +		(i " " (modal) " deny " (group) " access to " (thingss))
          195  +	
          196  +		((group) " are " (adjective))
          197  +		((group) " are not " (adjective))
          198  +		
          199  +		((thing) " " (causes-provokes) " " (thingss))
          200  +		((things) " " (cause-provoke) " " (thingss))
          201  +		((thingss) " " (modal) " cause " (problem))
          202  +		(i " " (causes-provokes) " " (problem))
          203  +		(i " " (modal) " cause " (problem))
          204  +		
          205  +		(i " lacks class character")
          206  +		((group) " have class character")
          207  +		((group) " lack class character")
          208  +		((thing) " has class character")
          209  +		((things) " have class character")
          210  +		((thing) " lacks class character")
          211  +		((things) " lack class character")
          212  +		
          213  +	
          214  +		((problem) " " (modal-rnd) " be solved in our lifetimes")
          215  +		
          216  +		(i " fails to address " (problem))
          217  +		(i " does not address " (problem))
          218  +		(i " disregards " (problem))
          219  +		(i " is not a solution for " (problem))
          220  +		(i " does not solve " (problem))
          221  +		(i " cannot solve " (problem))
          222  +			
          223  +	)
          224  +(rule (predicate i)
          225  +	(i " was developed after " (ideology))
          226  +	(i " was built on " (ideology))
          227  +	(i " was inspired by " (ideology))
          228  +	(i " was influenced by " (ideology))
          229  +	(i " is an ideological descendent of " (ideology))
          230  +	
          231  +	(i " was developed by " (group))
          232  +	(i " was developed to address the needs of " (group))
          233  +	(i " was developed to address the needs of " (group) ", not " (group))
          234  +	
          235  +	("the main contradiction of " i " is " (problem))
          236  +	
          237  +	((group) " believe that " (pc claim (ideology))))
          238  +	
          239  +(rule (claim i)
          240  +	((problem) " " (modal) " inevitably arise")
          241  +	((problem) " " (modal) " still exist")
          242  +	((problem) " " (modal) " " (cause-provoke) " " (problem))
          243  +	((problem) " " (modal) " " (cause-provoke) " the defeat of " i)
          244  +	((problem) " cannot be distinguished from " i)
          245  +	(i " and " (ideology) " cannot be distinguished")
          246  +	(i " and " (ideology) " will produce the same result")
          247  +
          248  +	((group) " " (modal) " be exploited")
          249  +	((group) " " (modal) " still be exploited")
          250  +	((group) " " (modal) " be exploited under " i)
          251  +	((group) " " (modal) " still be exploited under " i)
          252  +	((group) " " (modal) " face " (problem))
          253  +	
          254  +	(i " " (modal) " kill " (group))
          255  +	
          256  +	((thing) " is " (adjfor (adjective) " for " (group)))
          257  +	((things) " are " (adjfor (adjective) " for " (group)))
          258  +	((thing) " is actually " (adjfor (adjective) " for " (group)))
          259  +	((things) " are actually " (adjfor (adjective) " for " (group)))
          260  +	
          261  +	((problem) " " (modal) " benefit " (group))
          262  +	((problem) " " (modal) " harm " (group))
          263  +	((problem) " " (modal) " destroy " (group))
          264  +	((problem) " " (modal) " incite " (group) " against " (group))
          265  +	((problem) " " (modal) " incite " (group) " against " (problem))
          266  +	((problem) " is unfair to " (group))
          267  +	
          268  +	((problem) " is likely to result")
          269  +	((thing) " is likely to result")
          270  +	((things) " are likely to result")
          271  +	((thing) " is likely to be involved")
          272  +	((things) " are likely to involved")
          273  +	
          274  +	((thing) " is harmful to " (group))
          275  +	((things) " are harmful to " (group))
          276  +	((thingss) " " (modal) " " (cause-provoke) " the oppression of " (group))
          277  +	((cause (group) i) " face " (problem))
          278  +	((cause (group) i) " suffer " (problem))
          279  +	((cause (group) i) " suffer from " (problem))
          280  +	((cause (group) i) " experience " (problem))
          281  +	((cause (group) i) " no longer experience " (problem))
          282  +	
          283  +	((cause (group) i) " suffer")
          284  +	((cause (group) i) " be marginalized")
          285  +	((cause (group) i) " become marginalized")
          286  +	((cause (group) i) " become exploited")
          287  +	((cause (group) i) " become addicted to " (thingss))
          288  +	((cause (group) i) " lose " (trait))
          289  +	((cause (group) i) " lose " (things))
          290  +	((cause (group) i) " lose their " (trait))
          291  +	((cause (group) i) " lose their " (things))
          292  +	((cause (group) i) " no longer have " (necessity))
          293  +	((cause (group) i) " lose access to " (necessity))
          294  +	)
          295  +
          296  +(rule (pc p i) ((p i)) ((predicate-or-claim (pick (vector "it" i)))))
          297  +(rule (statement i)
          298  +	((pc predicate i))
          299  +	((pc claim i))
          300  +	("i think " (pc claim i))
          301  +	("it is my considered opinion that " (pc claim i))
          302  +	("i think we all know that " (pc claim i))
          303  +	("nobody would deny that " (pc claim i))
          304  +	((pc predicate i) ", therefore " (pc claim i))
          305  +	((pc claim i) " because " (predicate i))
          306  +	("if " (pc predicate i) ", " (pc claim i))
          307  +	("if " (pc predicate i) ", then " (pc claim i))
          308  +	("because " (pc predicate i) ", " (pc claim i))
          309  +	("since " (pc predicate i) ", " (pc claim i))
          310  +	("as a result of " (problem) ", " (pc claim i))
          311  +	("due to " (problem) ", " (pc claim i))
          312  +	("despite what " (group) " think, " (pc claim i))
          313  +	("despite what " (group) " think about " (problem) ", " (pc claim i))
          314  +	("while " (group) " think " (pc claim i) ", the reality is that " (pc claim i))
          315  +	)
          316  +	
          317  +(print (statement (ideology)) "\n")

Added bottist.ml version [ef9918389c].

            1  +let adjs = [| "queer"; "electric"; "space"; "super"; "discount"; "extreme"; "far-left";
            2  +    "far-right"; "unreconstructed"; "modern"; "eternal"; "original"; "historical"; "tankie"; "mystical"; "arcane"; "catholic"; "protestant"; "irish"; "dialectical"; "confucian"; "orbital"; "suborbital"; "martian"; "minimalist"; "moist"; "dire"; "trotskyite"; "trotskyist"; "supreme"; |] 
            3  +let prefixes = [|"neo"; "post"; "retro"; "anti"; "counter"; "pre"; "paleo"; "femino"; "anarcho"; "oligo"; "meta"; "diabolo"; "theo"; "petro"; "sado"; "arachno"; "psycho"; "eroto";
            4  +    "nano"; "mini"; "xeno"; "astro"; "femto"; "electro"; "endo"; "arch"; "macro"; 
            5  +    "cardio"; "mesmo"; "chrono"; "nycto"; "megalo"; "lesbo"; "masculo"; "ultra"; "urtla";
            6  +    "proto"; "weebo"; "thanato"; "volcano"; "strangulo"; "quasi"; "pseudo"; "procto";
            7  +    "copro"; "hydro"; "gastro"; "thermo"; "mystico"; "arcano"; "disastro"; "vagino"; "dino"; "nympho"; "pharma"; |]
            8  +let ists  = [| "plurali"; "femini"; "activi"; "sociali"; "marxi"; "lenini"; "stalini"; "fasci"; "sadi"; "stirneri"; "masochi"; "imperiali"; "arcani"; "syndicali"; "masturbati"; "pedantici"; "posadi"; "hoxhai"; "maoi"; "papi"; "catholici"; "protestanti"; "coloniali"; "francoi"; "materiali"; "immateriali"; "sexuali"; "stallmani"; "minarchi"; "totalitariani"; "authoritariani"; "revisioni"; "legali"; "supremaci"; "masculi"; "primitivi"; |]
            9  +
           10  +let range min max = (Random.int (max-min)) + min
           11  +let chance n = range 0 n = 0
           12  +let pick (r: 'a array) : 'a = r.(range 0 (Array.length r));;
           13  +
           14  +let rec accumulate fn times = fn () ^ if times = 0 then "" else " "^(accumulate fn (times-1))
           15  +let makeist () = (if chance 2 then (pick prefixes)^"-" else "") ^ (pick ists)^(pick [|"st"; "te"|])
           16  +let ideology () = (if chance 3 then (if chance 4 then (pick prefixes) else "") ^ (pick adjs)^" "  else "" ) ^ (accumulate makeist (range 0 2)) ^ " " ^ (if chance 2 then ((if chance 3 then pick prefixes else "") ^"anarchism") else (pick [|"anarcho-";"arachno-"|])^(pick ists)^"sm")
           17  +let () = Random.self_init (); print_string (ideology ())
           18  +	

Added cclg.ml version [f3cecc2737].

            1  +type word = A of string | An of string
            2  +type root = Edy of word | Xy of word | Ation of word | Le of word | A of word | Cy of word
            3  +	| Rous of word | Ics of word | Ics2 of word | Sis of word | X of word | Ality of word | Ty of word
            4  +	| Ication of word | Tion of word | Arity of word | Sm of word
            5  +type prefix = Inv of word | Vf of word * string
            6  +let prefixes = [|
            7  +	Vf(A "mult","i"); Inv (A "pre"); Vf(An "ex","o"); Vf(A "retr","o");
            8  +	Inv (A "hyper"); Vf(A "hem","i"); Inv (A "eu"); Vf(A "par","a");
            9  +	Vf(A "gastr","o"); Vf(A "bell","i"); Inv (An "an"); Vf(A "mes","o");
           10  +	Vf(A "therm","o"); Vf(A "copr","o"); Vf(A "pleb","i"); Vf(An "ant","i");
           11  +	Vf(A "pseud","o"); Vf(A "quas", "i"); Vf(A "crypt","o"); Vf(A "bronch","o");
           12  +	Vf(A "hydr","o"); Vf(A "psych","o"); Vf(A "tel","e"); Vf(An "arachn","o");
           13  +	Vf(A "nyct","o"); Inv(A "dys"); Inv(A "mis"); Vf(A "mis","o"); Vf(A "the","o");
           14  +	Vf(A "terr","a"); Vf(An "astr","a"); Vf(An "astr","o"); Vf(An "archae","o");
           15  +	Vf(An "erot","o"); Vf(A "proct","o"); Vf(An "atm","o"); Vf(A "strat","o");
           16  +	Inv(A "geo"); Vf(An "omn","i"); Inv(A "poly"); Vf(A "malign","o");
           17  +	Vf(A "micr","o"); Vf(A "macr","o"); Vf(A "nan","o"); Vf(A "femt","o");
           18  +	Vf(A "kil","o"); Vf(A "pet","a"); Inv(A "tri"); Vf(A "tetr","a");
           19  +	Vf(A "yoct","o"); Vf(A "meg","a"); Vf(A "un","i"); Inv(A "bi"); Vf(A "dec","a");
           20  +	Vf(A "pent","a"); Inv(An "endo"); Vf(An "electr","o"); Vf(A "pat","a");
           21  +	Vf(A "hem","o"); Inv(An "arch"); Vf(A "mesm","o");  Vf(A "card","io");
           22  +	Vf(A "necr","o"); Inv(An "un"); Vf(An "ultr","a"); Inv(A "trans");
           23  +	Inv(A "post"); Inv(A "sub"); Inv(A "pro"); Vf(A "ben","e"); Inv(An "ab");
           24  +	Inv(An "inter"); Vf(An "intr","a"); Inv(A "non"); Inv(A "counter");
           25  +	Vf(A "contr","a"); Vf(A "path","o"); Vf(A "phon","o"); Inv(A "pan");
           26  +	Vf(A "zo","o"); Vf(A "chron","o"); Inv(A "re"); Inv(A "con"); Vf(A "volcan","o");
           27  +	Inv(A "tech"); Vf(A "plasm","o"); Vf(A "megal","o"); Inv(A "cyber"); 
           28  +	Vf(A "met","a"); Inv(A "neo"); Vf(An "ocul","o"); Vf(A "strangul","o");
           29  +	Vf(A "dendr","o"); Vf(A "matr","i"); Vf(A "patr","i"); Vf(A "lesb","o");
           30  +	Vf(A "hom","o"); Vf(A "heter","o"); Vf(A "prot","o"); Vf(An "ect","o");
           31  +	Vf(A "weeb","o"); Vf(A "fung","i"); Vf(A "per","i"); Vf(A "petr","i");
           32  +	Vf(A "sad","o"); Vf(A "femin","i"); Vf(A "mascul","o"); Vf(A "claustr","o");
           33  +    Vf(A "neur","o"); Vf(A "norm","o"); Inv (A "eu");
           34  +
           35  +	Vf(An "agor","a"); Vf(A "thanat","o"); Vf(A "vagin","o"); Vf(A "bi","o"); 
           36  +	Vf(A "blog","o"); Vf(A "prometh","eo"); Vf(An "anesthes", "io");
           37  +    Vf(A "din","o"); Vf(A "medic","o");
           38  +|]
           39  +
           40  +let roots = [|
           41  +	Edy (A "com");
           42  +	Edy (A "trag");
           43  +	Xy (A "gala");
           44  +	Ation (A "lact");
           45  +	Le (A "mirac");
           46  +	Rous (A "fib");
           47  +	A (An "arcan");
           48  +	Cy (A "poli");
           49  +	Ty (A "poli");
           50  +	Ics (A "polit");
           51  +	Ics (A "mathemat");
           52  +	Ics2 (A "memet");
           53  +	Sis (A "mime");
           54  +	Ics (A "linguist");
           55  +	Ics2 (A "linguist");
           56  +	Ics2 (A "therm");
           57  +	Ics (A "cosmet");
           58  +	Ics (A "anesthet");
           59  +	Ics (A "techn");
           60  +	Sis (A "synthe");
           61  +	X (An "appendi");
           62  +	Ication (A "prognost");
           63  +	Ality (A "lachrym");
           64  +	Tion (A "prohibi");
           65  +	Ation (A "not");
           66  +	Ality (A "lingu");
           67  +	Arity (A "pulmon");
           68  +	Sis (A "sta");
           69  +	Sis (A "kine");
           70  +	Ality (A "lexic");
           71  +	Ality (A "mort");
           72  +	Ation (A "gener");
           73  +	Ality (A "nocturn");
           74  +	Cy (A "delica");
           75  +	Ation (A "masturb");
           76  +	Sm (An "orga");
           77  +	Sm (A "cla");
           78  +	Cy (A "malignan");
           79  +	Tion (A "func");
           80  +	Ics (A "dialect");
           81  +	Ics (A "pedant");
           82  +	Ation (A "form");
           83  +	Ation (A "dict");
           84  +	Tion (A "construc");
           85  +	Tion (A "trac");
           86  +	Tion (A "cep");
           87  +	Ation (A "port");
           88  +	Tion (A "scrip");
           89  +	Tion (A "junc");
           90  +	Ation (A "spir");
           91  +	Ation (A "coloniz");
           92  +	Ation (A "fornic");
           93  +	Ics (A "disastr");
           94  +	Ics (A "theatr");
           95  +	Ality (A "sexu");
           96  +	Ation (A "transl");
           97  +	Sm (A "sadi");
           98  +	Sm (A "masochi");
           99  +	Ation (An "ejacul");
          100  +	Ation (A "jacul");
          101  +	Ality (A "vagin");
          102  +	Ality (A "mystic");
          103  +	Sm (A "mystici");
          104  +	Ty (A "normativi");
          105  +	Ality (A "norm");
          106  +	Ality (A "typic");
          107  +	Xy (A "do");
          108  +	Ality (A "leg");
          109  +	Sm (A "legali");
          110  +	Ation (A "leg");
          111  +	A (A "pragmat");
          112  +	A (A "stigmat");
          113  +|]
          114  +
          115  +let nsuffixes = [|
          116  +	An "ite";
          117  +	An "ate";
          118  +	An "itis";
          119  +	A "sis";
          120  +	A "rrhea";
          121  +	A "tion";
          122  +	An "icon";
          123  +	A "phoria";
          124  +	A "cide";
          125  +	An "ology";
          126  +	An "ologics";
          127  +	An "ologer";
          128  +	An "ologist";
          129  +	A "phobia";
          130  +	A "sphere";
          131  +	A "spherics";
          132  +	A "gon";
          133  +	A "tron";
          134  +	A "metry";
          135  +	A "meter";
          136  +	A "noia";
          137  +	A "noiac";
          138  +	A "noid";
          139  +	A "cracy";
          140  +	A "crat";
          141  +	A "mancy";
          142  +	An "ism";
          143  +	An "ist";
          144  +	An "ary";
          145  +	An "ory";
          146  +	A "scope";
          147  +	A "jection";
          148  +	A "mission";
          149  +	A "ception";
          150  +	A "ceptor";
          151  +	An "arch";
          152  +	An "archy";
          153  +	A "turbation";
          154  +	A "turbator";
          155  +	A "plasm";
          156  +	A "mania";
          157  +	A "maniac";
          158  +	A "dendron";
          159  +	A "gasm";
          160  +	A "philia";
          161  +	A "philiac";
          162  +	A "phile";
          163  +	A "sexuality";
          164  +	A "romance";
          165  +	A "net";
          166  +	An "ium";
          167  +    A "saur";
          168  +    An "odon";
          169  +    A "normativity";
          170  +    A "typicality";
          171  +    A "doxy";
          172  +|]
          173  +let adjsuffixes = [|
          174  +	An "itic";
          175  +	An "ose";
          176  +	An "id";
          177  +	A "tic";
          178  +	A "rrheic";
          179  +	A "tive";
          180  +	An "iconic";
          181  +	A "phoric";
          182  +	A "cidal";
          183  +	An "ologic";
          184  +	An "ological";
          185  +	An "ologistic";
          186  +	A "phobic";
          187  +	A "spheric";
          188  +	A "gonal";
          189  +	A "tronic";
          190  +	A "metric";
          191  +	A "metrical";
          192  +	A "noiac";
          193  +	A "noid";
          194  +	A "cratic";
          195  +	A "mantic";
          196  +	An "ist";
          197  +	An "istic";
          198  +	An "ismic";
          199  +	An "ismatic";
          200  +	A "scopic";
          201  +	A "ject";
          202  +	A "jective";
          203  +	A "missive";
          204  +	A "ceptive";
          205  +	An "archic";
          206  +	A "turbatory";
          207  +	A "plasmic";
          208  +	A "plastic";
          209  +	A "manic";
          210  +	A "maniacal";
          211  +	An "ish";
          212  +	A "dendrite";
          213  +	A "gasmic";
          214  +	A "philic";
          215  +	A "sexual";
          216  +	A "romantic";
          217  +	A "legal";
          218  +	A "normative";
          219  +	A "typical";
          220  +|]
          221  +let (^^) w s = match w with
          222  +	An x -> An (x^s) | A x -> A (x^s);;
          223  +let pick (r : 'a array) : 'a = r.(Random.int(Array.length r))
          224  +let chance i = (Random.int i) = 0
          225  +let cform root = match root with
          226  +	| Edy x -> x^^"edo" | Xy x -> x^^"cto" | Ation x -> x^^"o"
          227  +	| Rous x -> x^^"ro" | Le x -> x^^"ulo" | A x -> x^^"o"
          228  +	| Cy x -> x^^"tico" | Ics x | Ics2 x -> x^^(if chance 2 then "i" else "o")
          229  +	| Sis x -> x^^"to"
          230  +	| X x -> x^^"co" | Ality x -> x^^"o" | Ty x -> x^^"to"
          231  +	| Ication x -> x^^"o" | Tion x -> x^^"to" | Arity x -> x^^"a"
          232  +	| Sm x -> x^^(if chance 2 then "smo" else "sto")
          233  +let bareform root = match root with
          234  +	| Edy x -> (if chance 2 then x else x^^"ed") | Xy x -> x^^"ct" | Ation x -> x
          235  +	| Rous x -> x^^"r" | Le x -> x^^"ul" | A x -> x
          236  +	| Cy x -> x^^"tic" | Ics x -> x^^"ic" | Ics2 x -> x | Sis x -> x^^"t"
          237  +	| X x -> x^^"c" | Ality x -> x | Ty x -> x^^"t"
          238  +	| Ication x -> x | Tion x -> x^^"t" | Arity x -> x
          239  +	| Sm x -> x^^"st"
          240  +let adjform root = match root with
          241  +	| Edy x -> x^^"ic" | Xy x -> x^^"ctic" | Ation x -> x^^"ic"
          242  +	| Rous x -> x^^"rous" | Le x -> x^^"ulous" | A x -> x^^"e"
          243  +	| Cy x -> x^^"tical" | Ics x -> x^^"ical" | Ics2 x -> x^^"ic" | Sis x -> x^^"tic"
          244  +	| X x -> x^^"cal" | Ality x -> x^^"al" | Ty x -> x^^"tical"
          245  +	| Ication x -> x^^(if chance 3 then "itious" else "icate")
          246  +	| Tion x -> x^^(match Random.int 4 with
          247  +		| 0 -> "tive" | 1 -> "ted" | 2 -> "cious" | 3 -> "tory" | _ -> assert false)
          248  +	| Arity x -> x^^"ary" | Sm x -> x^^(if chance 2 then "stic" else "smic")
          249  +let nform root = if chance 7 then (adjform root) ^^ "ness" else match root with
          250  +	| Edy x -> x^^"edy" | Xy x -> x^^"xy" | Ation x -> x^^(if chance 3 then "itor" else "ation")
          251  +	| Rous x -> x^^"er" | Le x -> x^^"le" | A x -> x^^"a"
          252  +	| Cy x -> x^^"cy" | Ics x -> x^^(if chance 3 then "ician" else "ics") | Sis x -> x^^"sis"
          253  +	| Ics2 x -> x^^(if chance 3 then "ician" else "ics")
          254  +	| X x -> x^^"x" | Ality x -> x^^"ality" | Ty x -> x^^"ty"
          255  +	| Ication x -> x^^"ication" | Tion x -> x^^"tion" | Arity x -> x^^"arity"
          256  +	| Sm x -> x^^(if chance 2 then "st" else "sm")
          257  +let abs (w:word) = match w with A x | An x -> x
          258  +let append pref w = match pref with
          259  +		| Inv x -> x ^^ (abs w)
          260  +		| Vf(body,v) ->	 match w with
          261  +			| An x -> body^^x
          262  +			| A x -> (body^^v)^^x
          263  +let rec word () : word = match Random.int 7 with
          264  +	| 0 -> nform (pick roots)
          265  +	| 1 -> (match pick nsuffixes with
          266  +		| An x -> (bareform (pick roots)) ^^ x
          267  +		| A x -> (cform (pick roots)) ^^ x)
          268  +	| 2 -> ((adjform (pick roots)) ^^ " ") ^^ (abs(word ()))
          269  +	| 3 -> ((match pick adjsuffixes with
          270  +		| An x -> (bareform (pick roots)) ^^ x
          271  +		| A x -> (cform (pick roots)) ^^ x) ^^ " ") ^^ (abs(word ()))
          272  +	| 4 -> append (pick prefixes) (word ())
          273  +	| 5 -> append (pick prefixes) (pick nsuffixes)
          274  +	| 6 -> ((append (pick prefixes) (pick adjsuffixes)) ^^ " ") ^^ (abs (word()))
          275  +	| _ -> assert false
          276  +let () = Random.self_init (); print_string (abs (word ())); ()

Added crime.ml version [a935c1d4c7].

            1  +type word = A of string | An of string | Article | Punctuation of string
            2  +type node = T of string | Tv of string | P of string | B of node list | N of node | R of node array | Indef | O of node | Fn of (unit -> word) | C of node
            3  +
            4  +let wconcat x y = match x, y with
            5  +	| (A(x),An(y)) | (A(x),A(y)) -> A(x^" "^y)
            6  +	| (An(x),An(y)) | (An(x),A(y)) -> An(x^" "^y)
            7  +	| _ -> assert false
            8  +let wprefix x y = match x, y with
            9  +	| (A(x),An(y)) | (A(x),A(y)) -> A(x^y)
           10  +	| (An(x),An(y)) | (An(x),A(y)) -> An(x^y)
           11  +	| _ -> assert false
           12  +
           13  +let range min max = (Random.int (max-min)) + min
           14  +let chance n = range 0 n = 0
           15  +let pick (r: 'a array) : 'a = r.(range 0 (Array.length r));;
           16  +
           17  +module CrimeDrug = struct
           18  +
           19  +let frics = [| "f"; "sh"; "th"; |]
           20  +let vfrics = [| "z"; "v"; "zh"; |]
           21  +let stops = [| "t"; "p"; "k"; "c"; |]
           22  +let vstops = [| "d"; "b"; "g"; "gh"; |]
           23  +let withglide r f = Array.map (fun i -> i^f) r
           24  +let withonset r o = Array.map (fun i -> o^i) r
           25  +let consonants = Array.concat [
           26  +	frics; vfrics; stops; vstops;
           27  +	withonset stops "s";
           28  +	[| "w"; "r"; "rh"; "s"; "l"; "ch"; "n"; "m"; |];
           29  +]
           30  +let initials = Array.concat [
           31  +	consonants;
           32  +	withglide frics "r"; withglide frics "l"; withglide frics "w";
           33  +	withglide stops "r"; withglide vstops "r"; withglide vstops "w";
           34  +	[| "qu"; "spr"; "spl"; "str"; "scr"; "scl"; "squ"; "bl"; "gl"; "sn"; "sm"; "j"; "h"; "sph"; "ph";|];
           35  +]
           36  +let nuclei = [| "e"; "ee"; "i"; "a"; "ou"; "u"; "oo"; "ea"; "oa"; "ai"; "oi"; "ie";|]
           37  +let finals = Array.concat [
           38  +	vstops;
           39  +	withonset stops "s"; withonset stops "r"; withonset stops "l";
           40  +	withonset vstops "r"; withonset vstops "l";
           41  +	[| "gh"; "ck"; "ce"; "ss"; "se"; "nd"; "mb"; "mph"; "nk"; "tch"; "ke"; "ght";
           42  +	"ff";  "ll"; "zz"; "t"; "p"; "th"; "rth"; "lth"; "dge"; "nge"; "ng"; "ft"; "ckle"; "ngle"; "rkle";
           43  +	"scht"; "ze"; "x"; "sh"; "rsh"; "lsh"; "ggle"; "ddle"; "bble"; "pple"; "rge"; "lge"; "ve"; "rve";
           44  +	"lve"; "ffle"; "ttle"; "kle"; "sch"; "m"; "n"; "rm"; "lm"; "rn"; "ln";|]
           45  +]
           46  +let prefixes = [| A "crack"; A "crystal"; A "powdered"; A"raw"; A "pure"; A "liquid";
           47  +	A"street"; A "super"; An "electric"; A "diced"; A "homemade"; A "traditional";
           48  +	An "old-school"; A "purified"; A "high-caliber"; A "high-octane"; An "old-fashioned";
           49  +	A "good old"; A "honest-to-god"; A "weapons-grade"; A "soviet"; An "american";
           50  +	A "canadian"; A "british"; A "russian"; A "synthetic"; A "french"; A "cyber"; |]
           51  +
           52  +let makeA i x = A(i ^ x)
           53  +let makeAn x = An x
           54  +let maybeConcat x y = match x with
           55  +	| Some t -> wconcat t y
           56  +	| None -> y
           57  +let gen () : word = maybeConcat (if chance 3 then Some (pick prefixes) else None)
           58  +	((if chance 5 then makeAn else makeA (pick initials))
           59  +		((pick nuclei) ^ (pick finals)))
           60  +		
           61  +end
           62  +
           63  +let rec crime = R [|
           64  +	Tv "arson";
           65  +	T "murder";
           66  +	T "jaywalking";
           67  +	T "larceny";
           68  +	T "sex";
           69  +	T "intercourse";
           70  +	T "acts unspeakable";
           71  +	T "public indecency";
           72  +	T "software piracy";
           73  +	T "piracy";
           74  +	T "theft";
           75  +	T "regicide";
           76  +	Tv "assault";
           77  +	T "battery";
           78  +	T "treason";
           79  +	T "bribery";
           80  +	T "manslaughter";
           81  +	T "bestiality";
           82  +	T "assault and battery";
           83  +	T "corruption";
           84  +	T "corruption of a minor";
           85  +	T "highway robbery";
           86  +	T "banditry";
           87  +	T "cattle rustling";
           88  +	T "looting";
           89  +	T "war crimes";
           90  +	T "crimes against humanity";
           91  +	T "breach of contract";
           92  +	T "crime";
           93  +	T "crimes";
           94  +	T "burglary";
           95  +	T "vandalism";
           96  +	T "robbery";
           97  +	T "forgery";
           98  +	T "counterfeiting";
           99  +	T "stalking";
          100  +	T "sabotage";
          101  +	T "sedition";
          102  +	T "shoplifting";
          103  +	T "corrupt practices";
          104  +	T "fire-raising";
          105  +	T "genocide";
          106  +	T "desertion";
          107  +	T "defamation";
          108  +	T "embezzlement";
          109  +	T "immigration";
          110  +	T "emigration";
          111  +	T "illegal immigration";
          112  +	T "illegal emigration";
          113  +	T "endangerment";
          114  +	T "extortion";
          115  +	T "failure to appear in court";
          116  +	T "abduction";
          117  +	T "kidnapping";
          118  +	T "fraud";
          119  +	T "tax fraud";
          120  +	T "homicide";
          121  +	T "extortion";
          122  +	T "mutiny";
          123  +	T "extortion";
          124  +	T "perverting the course of justice";
          125  +	T "perversion";
          126  +	T "tweeting";
          127  +	T "blogging";
          128  +	T "mommyblogging";
          129  +	T "vlogging";
          130  +	T "posting";
          131  +	T "posts";
          132  +	T "trespass";
          133  +	T "broadcasting";
          134  +	T "assembly";
          135  +	T "war profiteering";
          136  +	T "blackmail";
          137  +	T "cybercrime";
          138  +	T "espionage";
          139  +	T "hijacking";
          140  +	T "hooliganism";
          141  +	T "perjury";
          142  +	T "refusal to serve in a public office";
          143  +	B [ T  "failure to appear before"; Indef; profession ];
          144  +	B [ T  "refusal to serve as"; Indef; profession ];
          145  +	B [ T  "stalking"; O(T"of"); Indef; profession ];
          146  +	B [ T  "solicitation of"; Indef; profession ];
          147  +	B [ T "bribery of"; Indef; profession; ];
          148  +	B [ T "cruelty to"; Indef; profession; ];
          149  +	B [ T "fraudulent"; practice; ];
          150  +	B [ T "misuse of"; Indef; thing; ];
          151  +	B [ thing; T "forging"; ];
          152  +	B [ T "obtaining"; Indef; thing; T "by deception"; ];
          153  +	B [ T "detonation of"; R[|B[Indef; thing];thingp|]; ];
          154  +	B [ T "conspiracy to commit"; O prefix; crime; ];
          155  +	B [ T "conspiracy to practice"; O prefix; practice ];
          156  +	B [ T "possession of"; 
          157  +		R[|
          158  +			B[Indef; thing];
          159  +			thingp;
          160  +			Fn CrimeDrug.gen;
          161  +		|];
          162  +		O(T "with intent to distribute")
          163  +	];B [ T "use of"; 
          164  +		R[|
          165  +			B[Indef; thing];
          166  +			thingp;
          167  +			Fn CrimeDrug.gen;
          168  +		|];
          169  +	];
          170  +	B [ T "conspiracy to misuse"; Indef; thing ];
          171  +	T "tax evasion";
          172  +	T "fare evasion";
          173  +	B [ T  "conduct unbecoming"; Indef; profession ];
          174  +	B [ T "deployment of"; Indef; thing ];
          175  +	B [ R[|T "provision of"; T "distribution of"|]; R[|
          176  +			B[Indef; thing];
          177  +			thingp;
          178  +			Fn CrimeDrug.gen;
          179  +		|];
          180  +		O(R[|T"to minors"; T"to a minor"|]);
          181  +	];
          182  +	B [ Tv "purchase of"; Indef; thing ];
          183  +	B [ Tv "delivery of"; Indef; thing; T "to"; Indef; profession];
          184  +|] and gerundcrime = R [|
          185  +	B [ T "impersonating"; Indef; profession ];
          186  +	B [ T "breaking and"; doing; ];
          187  +	B [ T "practicing"; O prefix; practice; ];
          188  +	B [ T "practicing the"; instrument; ];
          189  +	B [ Tv "approaching"; Indef; profession ];
          190  +	B [ T "receiving stolen"; thingp ];
          191  +	B [ T "deploying"; Indef; thing ];
          192  +	T "being horny";
          193  +	T "marketing";
          194  +	T "advertising";
          195  +	T "unlawful restraint";
          196  +	T "trespassing";
          197  +|] and doing = R [|
          198  +	Tv "entering";
          199  +	T "decorating";
          200  +	Tv "invoking";
          201  +	Tv "evoking";
          202  +	Tv "insulting";
          203  +	Tv "advertising";
          204  +	Tv "mentoring";
          205  +	Tv "bantering";
          206  +	Tv "yiffing";
          207  +	Tv "posting";
          208  +	Tv "tweeting";
          209  +	Tv "blogging";
          210  +|] and practice = R [|
          211  +	T "falconry";
          212  +	T "dentistry";
          213  +	T "philosophy";
          214  +	T "linguistics";
          215  +	T "conjuration";
          216  +	T "illusion";
          217  +	T "mathematics";
          218  +	T "set theory";
          219  +	T "math";
          220  +	T "physics";
          221  +	T "astrophysics";
          222  +	T "natural philosophy";
          223  +	T "chemistry";
          224  +	T "engineering";
          225  +	T "marketing";
          226  +	T "advertising";
          227  +	T "blogging";
          228  +	T "tweeting";
          229  +	T "posting";
          230  +	B[T "forensic"; practice];
          231  +|] and instrument = R [|
          232  +	T "clarinet";
          233  +	T "piano";
          234  +	Tv "oboe";
          235  +	T "flute";
          236  +	T "violin";
          237  +|] and thing = R [|
          238  +	T "clarinet";
          239  +	T "piano";
          240  +	T "deadly weapon";
          241  +	T "firearm";
          242  +	T "weapon";
          243  +	T "sex doll";
          244  +	T "rhinocerous";
          245  +	T "farm animal";
          246  +	T "landmine";
          247  +	T "rocket launcher";
          248  +	T "rocket-propelled grenade";
          249  +	T "grenade";
          250  +	T "ballistic missile";
          251  +	T "ICBM";
          252  +	T "rifle";
          253  +	T "vibrator";
          254  +	Tv "assault rifle";
          255  +	Tv "assault weapon";
          256  +	Tv "automatic weapon";
          257  +	Tv "artifact";
          258  +	Tv "orb";
          259  +	T "cursed object";
          260  +	Tv "infectious disease";
          261  +	T "nuclear weapon";
          262  +	T "bioweapon";
          263  +	T "chemical weapon";
          264  +	T "memetic hazard";
          265  +	T "metaphor";
          266  +	T "simile";
          267  +	Tv "analogy";
          268  +	T "turkey baster";
          269  +	T "rolling pin";
          270  +	T "household item";
          271  +	Tv "appliance";
          272  +	T "blog";
          273  +	T "post";
          274  +	T "tweet";
          275  +|] and thingp = R [|
          276  +	T "clarinets";
          277  +	T "pianos";
          278  +	T "deadly weapons";
          279  +	T "firearms";
          280  +	T "weapons";
          281  +	T "sex dolls";
          282  +	T "rhinoceri";
          283  +	T "farm animals";
          284  +	T "landmines";
          285  +	T "rocket launchers";
          286  +	T "rocket-propelled grenades";
          287  +	T "grenades";
          288  +	T "ballistic missiles";
          289  +	T "ICBMs";
          290  +	T "rifles";
          291  +	T "vibrator";
          292  +	T "handcuffs";
          293  +	Tv "assault rifles";
          294  +	Tv "assault weapons";
          295  +	Tv "automatic weapons";
          296  +	Tv "artifacts";
          297  +	Tv "orbs";
          298  +	T "hazardous materials";
          299  +	T "gender";
          300  +	T "cursed objects";
          301  +	Tv "infectious diseases";
          302  +	Tv "internet access";
          303  +	T "nuclear material";
          304  +	T "nuclear weapons";
          305  +	T "bioweapons";
          306  +	T "chemical weapons";
          307  +	T "memetic hazards";
          308  +	T "cognitohazardous materials";
          309  +	T "propaganda";
          310  +	T "metaphors";
          311  +	T "similes";
          312  +	Tv "analogies";
          313  +	T "turkey basters";
          314  +	T "rolling pins";
          315  +	T "household items";
          316  +	Tv "appliances";
          317  +	T "stolen property";
          318  +	T "blogs";
          319  +	T "posts";
          320  +	T "tweets";
          321  +|] and profession = R [|
          322  +	T "public official";
          323  +	Tv "officer of the law";
          324  +	T "justice of the peace";
          325  +	T "locksmith";
          326  +	T "blacksmith";
          327  +	T "silversmith";
          328  +	T "magician";
          329  +	T "conjurer";
          330  +	Tv "illusionist";
          331  +	T "criminal";
          332  +	T "career criminal";
          333  +	T "drug dealer";
          334  +	T "schoolteacher";
          335  +	T "con artist";
          336  +	T "conman";
          337  +	T "burglar";
          338  +	T "poet";
          339  +	Tv "artisan";
          340  +	Tv "artist";
          341  +	T "courtesan";
          342  +	T "street artist";
          343  +	T "bartender";
          344  +	T "cattle rustler";
          345  +	T "celebrity";
          346  +	T "blogger";
          347  +	T "mommyblogger";
          348  +	B [ T "professor of"; practice ];
          349  +	B [ T "master of"; practice ];
          350  +	B [ practice; T "master" ];
          351  +	B [ practice; T "professor" ];
          352  +	B [ practice; T "expert" ];
          353  +	B [ thing; T "expert" ];
          354  +|] and prefix = R [|
          355  +	Tv "unjustified";
          356  +	Tv "unjustifiable";
          357  +	T "justifiable";
          358  +	Tv "unspeakable";
          359  +	T "tactless";
          360  +	Tv "indecent";
          361  +	Tv "intemperate";
          362  +	Tv "attempted";
          363  +	Tv "unlawful";
          364  +	T "malicious";
          365  +	Tv "aggravated";
          366  +	T "dread";
          367  +	T "horny";
          368  +	T "erotic";
          369  +	T "sexual";
          370  +	T "careless";
          371  +	T "negligent";
          372  +	T "first-degree";
          373  +	T "second-degree";
          374  +	T "third-degree";
          375  +	T "culpable and reckless";
          376  +	T "criminal";
          377  +	T "illegal";
          378  +	T "forcible";
          379  +	T "fractal";
          380  +|] and suffix = R [|
          381  +	B [ T "with intent to commit"; crime ];
          382  +	T "in a public place";
          383  +	T "in a court of law";
          384  +	T "on public transit";
          385  +	T "on the high seas";
          386  +	Tv "in anger";
          387  +	T "without a license";
          388  +	T "without lawful cause";
          389  +	B [ T "in the commission of"; crime ];
          390  +	B [ T "with"; Indef; thing ];
          391  +	B [ T "with"; thingp ];
          392  +	B [ T "with multiple"; thingp ];
          393  +	T "with intent to provoke a breach of the peace";
          394  +	T "with intent to commit a breach of the peace";
          395  +	B [ T "while acting in an official capacity"; O(B[T"as"; Indef; profession])];
          396  +	B [ T "in the presence of"; Indef; profession ];
          397  +	T "in the first degree";
          398  +	T "in the second degree";
          399  +	T "in the third degree";
          400  +	T "in the vicinity of a school";
          401  +	T "with malice aforethought";
          402  +	T "with malicious intent";
          403  +	T "with violent intent";
          404  +	B [ T "unbecoming"; Indef; profession ];
          405  +	T "under false pretenses";
          406  +|]
          407  +
          408  +let charge = R [|
          409  +	B[ O prefix; crime; O suffix; ];
          410  +	B[ prefix; practice; O suffix; ];
          411  +	B[ gerundcrime; O suffix; ];
          412  +|]
          413  +
          414  +let rec eval node : word list = match node with
          415  +	| T x -> [A x]
          416  +	| Tv x -> [An x]
          417  +	| B l -> List.fold_left (fun (a:word list) (n:node) : word list -> a @ (eval n)) [] l
          418  +	| P p -> [Punctuation p]
          419  +	| R a -> eval(pick a)
          420  +	| O n -> if chance 2 then eval n else []
          421  +	| Fn f -> [f ()]
          422  +	| Indef -> [Article]
          423  +	| N n -> eval n (* unnecessary? *)
          424  +	| C n -> match eval n with
          425  +		| A i :: rs-> A(String.capitalize_ascii i) :: rs
          426  +		| An i :: rs-> An(String.capitalize_ascii i) :: rs
          427  +		| _ as i -> i
          428  +
          429  +(* TODO: make tail-recursive *)
          430  +let rec flatten (s : word list) : string = match s with
          431  +	| Article :: A w :: rs -> " a "^w^(flatten rs)
          432  +	| Article :: An w :: rs -> " an "^w^(flatten rs)
          433  +	| Punctuation p :: rs -> p^(flatten rs)
          434  +	| A w :: rs | An w :: rs -> " "^w^(flatten rs)
          435  +	| [] -> ""
          436  +	| _ -> assert false
          437  +	
          438  +let numbers = R [| T "two"; T "three"; T "four"; T "five"; T "six"; T "seven";
          439  +	Tv "eight"; T "nine"; T "ten"; |]
          440  +let court = B[
          441  +	R[|T "the"; T "this"; |];
          442  +	O(R[|T "august"; T "noble"; T "glorious"; T "honorable"; T "grand";
          443  +		T "eminent"; T "splendid"; T "superb"; T "infallible"; T "holy";
          444  +		T "supreme";|]);
          445  +	R[|T "court"; T "tribunal"; T "court of law"; T "committee"; 
          446  +		Tv "inquisition"; |];
          447  +]
          448  +let accusation = C(B [
          449  +	Tv "you";
          450  +	R [|
          451  +			R[|
          452  +				B[
          453  +					T "stand";
          454  +					R[|
          455  +						T "here";
          456  +						B[T "before"; court;];
          457  +					|];
          458  +					O(T "today");
          459  +				]
          460  +			|];
          461  +		Tv "are";
          462  +	|];
          463  +	R[|
          464  +		B[T "to face justice for"; O(B[numbers; T "counts of"])];
          465  +		B[
          466  +			R[|
          467  +				Tv "accused";
          468  +				T "to face charges";
          469  +				T "to answer charges";
          470  +			|];
          471  +			R[|
          472  +				B[Tv "on"; numbers; T "counts of"];
          473  +				Tv "of";
          474  +			|]
          475  +		];
          476  +	|];
          477  +	charge;
          478  +	P ".";
          479  +	O(R[|
          480  +		T "How do you plead?";
          481  +		T "What say you?";
          482  +		T "How do you answer the charges?";
          483  +		T "What is your plea?";
          484  +		T "Explain yourself!";
          485  +	|]);
          486  +])
          487  +let sentence = B[
          488  +	R[|
          489  +		B[
          490  +			R[| T "You are"; T "The defendant is"; T "The accused party is"; |];
          491  +			O(T "hereby");
          492  +			O(T "stripped of all rank and");
          493  +			R[|T "sentenced"; T "condemned"|];
          494  +		];
          495  +		B[
          496  +			Tv "I";
          497  +			O(T "hereby");
          498  +			R[|T "sentence"; T "condemn"|];
          499  +			R[| T "you"; T "the defendant"; T "the accused party";|];
          500  +		];
          501  +	|];
          502  +	T "to";
          503  +]
          504  +let condemnation = B[
          505  +	sentence;
          506  +	R[|
          507  +		B[
          508  +			T "die";
          509  +			O(T "screaming");
          510  +			O(T "in agony");
          511  +			O(B[
          512  +				T "by";
          513  +					O(T "prolonged");
          514  +					O(T "ritual");
          515  +					O(T "public");
          516  +					R[| T "beheading"; T "strangulation"; T "torture";
          517  +						T "industrial negligence"; T "slow slicing"; T "lethal injection";
          518  +						T "disembowelment"; T "drowning"; T "burning";
          519  +						T "burning at the stake"; T "emasculation"; T "irradiation";
          520  +						T "stabbing"; T "poisoning"; T "flaying"; T "roasting";
          521  +						T "boiling"; T "boiling in oil"; T "boiling in acid";
          522  +						T "crucifixion"; |]
          523  +			]);
          524  +		];
          525  +		T "hang";
          526  +		T "hang until dead";
          527  +		T "hang until you are dead";
          528  +		T "be drawn and quartered";
          529  +		T "drown";
          530  +		T "burn";
          531  +		T "burn at the stake";
          532  +		T "be burned";
          533  +		T "be burned at the stake";
          534  +		T "be broken on the wheel";
          535  +		T "be torn apart by wild horses";
          536  +	|];
          537  +	O(R[|
          538  +		B[
          539  +			T "at";
          540  +			R[|
          541  +				T "dawn"; T "dusk"; T "noon"; T "high noon"; T "sunrise"; T "sunset";
          542  +			|]
          543  +		];
          544  +		T "within one week";
          545  +		T "within the hour";
          546  +		T "by day's end";
          547  +	|])
          548  +]
          549  +let imprisonment = B[
          550  +	sentence;
          551  +	R[|
          552  +		B[
          553  +			R[|T "two"; T "three"; T "four"; T "five"; T "six"; T "seven";
          554  +			Tv "eight"; T "nine"; T "ten";|];
          555  +			R[|T "seconds"; T "minutes"; T "days"; T "weeks";  T "years"; T "decades"; T "millennia";
          556  +				T "hundred years"; T "thousand years"; Tv "eons"; Tv "ages"; Tv "eras"; T "million years";
          557  +				T "billion years"; T "trillion years"; |];
          558  +		];
          559  +		B[
          560  +			R[|Indef;Tv "one";|];
          561  +			R[|T "second"; T "minute"; T "day"; T "week";  T "year"; T "decade"; T "millennium";
          562  +				T "hundred years"; T "thousand years"; Tv "eon"; Tv "age"; Tv "era"; T "million years";
          563  +				T "billion years"; T "trillion years"; |];
          564  +		];
          565  +		Tv "a lifetime";
          566  +		Tv "an eternity";
          567  +	|];
          568  +	R[|Tv "of community service"; Tv "in state prison"; Tv "in federal prison"; Tv "in prison"; 
          569  +		Tv "of jail time"; Tv "of prison time"; B[T "without"; R[|B[Indef; thing];thingp|];];
          570  +		Tv "alone"; T "in the gulag"; Tv "in a labor camp"; Tv "in the county jail";
          571  +		T "thinking about what you've done"; Tv "of penance"; Tv "in the Box";
          572  +		Tv "in the Shame Cube"; Tv "in the nightmares of children";
          573  +		Tv "in a magic lamp";Tv "in a cursed mirror"; Tv "of indentured servitude"; Tv "of slavery";|];
          574  +]
          575  +let status = R[|
          576  +	T "citizenship";
          577  +	T "rank";
          578  +	T "all rank";
          579  +	T "all status";
          580  +	T "all rights";
          581  +	T "all privileges";
          582  +	T "all clearances";
          583  +	T "all certifications";
          584  +|]
          585  +let banishment = B [
          586  +	R[|
          587  +		B[
          588  +			T "You are";
          589  +			O(T "hereby");
          590  +			O(B[T "stripped of your citizenship and";]);
          591  +			O(T "forever");
          592  +			R[|T "exiled"; T "banished";|];
          593  +		];
          594  +		B[
          595  +			R[|T "The defendant is"; T "The accused party is"; |];
          596  +			O(T "hereby");
          597  +			O(B[T "stripped of"; R[|T"her"; T"his"; T"its"; T"their";|]; T "citizenship and";]);
          598  +			O(T "forever");
          599  +			R[|T "exiled"; T "banished";|];
          600  +		];
          601  +		B[
          602  +			Tv "I";
          603  +			O(T "hereby");
          604  +			O(T "strip you of your citizenship and");
          605  +			R[|T "exile"; T "banish";|];
          606  +			T "you";
          607  +			O(T "forever");
          608  +		];
          609  +	|];
          610  +	O(B[
          611  +		T "from";
          612  +		R[|
          613  +			T "the Realm";
          614  +			T "the Kingdom";
          615  +			T "the Empire";
          616  +			T "the Republic";
          617  +			T "the Federation";
          618  +		|];
          619  +	]);
          620  +	O(B[
          621  +		T "to";
          622  +		O(B[O(T"forever"); T "wander"]);
          623  +		T "the";
          624  +		R[|
          625  +			T "howling";
          626  +			T "dark";
          627  +			T "empty";
          628  +			T "abyssal";
          629  +			T "cursed";
          630  +			T "abandoned";
          631  +			T "barbarous";
          632  +			T "forgotten";
          633  +			T "lost";
          634  +			T "forsaken";
          635  +			T "desert";
          636  +		|];
          637  +		R[|
          638  +			T "marshes";
          639  +			T "woods";
          640  +			T "forest";
          641  +			T "marsh";
          642  +			T "plain";
          643  +			T "plains";
          644  +			T "wastes";
          645  +			T "pit";
          646  +			T "shores";
          647  +			T "desert";
          648  +		|];
          649  +	]);
          650  +]
          651  +let order = B [
          652  +	R[|
          653  +		B[
          654  +			R[| T "You are"; T "The defendant is"; T "The accused party is"; |];
          655  +			O(T "hereby");
          656  +			O(B[T "stripped of"; status; Tv "and";]);
          657  +			R[|T "ordered"; T "commanded"; T "enjoined"; T "required";|];
          658  +		];
          659  +		B[
          660  +			Tv "I";
          661  +			O(T "hereby");
          662  +			R[|
          663  +				B[T "strip you of"; status; T "and";
          664  +					R[|T "order"; T "command"; T "enjoin"; T "require";|];
          665  +					T "you";
          666  +				];
          667  +			|];
          668  +		];
          669  +	|];
          670  +	T "to"; 
          671  +	R[|
          672  +		B[T "perform"; R[|T "one"; numbers;|]; T "hundred jumping jacks"];
          673  +		T "make amends";
          674  +		T "beg forgiveness";
          675  +		T "do the right thing";
          676  +		T "bleed";
          677  +		T "sacrifice your firstborn";
          678  +		T "forever quit the land of your birth";
          679  +		B[
          680  +			T "pay a fine of";
          681  +			numbers; (* TODO better numbers *)
          682  +			O(R[|T "hundred"; T "thousand"; T "hundred thousand"; T "million"; T "billion"; T "trillion";|]);
          683  +			R[| T "dollars"; T "credits"; T "units"; T "cows"; T "heads of cattle"; T "sand dollars";
          684  +				T "gold"; T "silver"; T "pounds"; T "pence"; T "pounds stirling"; T "talents";
          685  +				T "sovereigns"; T "dried yak teeth"; T "cursed fairy coins"; T "ultradollars";|];
          686  +		];
          687  +	|];
          688  +]
          689  +let reduce = B [
          690  +	R[|
          691  +		B[
          692  +			R[| T "You are"; T "The defendant is"; T "The accused party is"; |];
          693  +			O(T "hereby");
          694  +			O(B[T "stripped of"; status; Tv "and";]);
          695  +			R[|T "condemned"; T "reduced"; T "reassigned";|];
          696  +		];
          697  +		B[
          698  +			Tv "I";
          699  +			O(T "hereby");
          700  +			R[|
          701  +				B[T "strip you of"; status; T "and";
          702  +					R[|T "condemn"; T "reduce"; T "reassign";|];
          703  +					T "you";
          704  +				];
          705  +				B[
          706  +					T "strip";
          707  +					R[|T "the defendant"; T "the accused party";|];
          708  +					Tv "of"; status; T "and";
          709  +					R[|T "condemn"; T "reduce"; T "reassign";|];
          710  +					R[|T "her"; T "him"; T "it"; T "them";|];
          711  +				];
          712  +				B[
          713  +					R[|T "condemn"; T "reduce"; T "reassign";|];
          714  +					R[|T "you"; T "the defendant"; T "the accused party";|];
          715  +				];
          716  +			|];
          717  +		];
          718  +	|];
          719  +	T "to"; 
          720  +	R[|
          721  +		T "slavery";
          722  +		T "undercaste status";
          723  +		T "prole status";
          724  +		T "servitude";
          725  +		T "Infrared Clearance";
          726  +		T "unskilled labor";
          727  +		T "kitchen duty";
          728  +		T "sanitation duty";
          729  +		T "court jester";
          730  +	|];
          731  +]
          732  +let conviction = C(B [
          733  +	O(B[
          734  +		R[|
          735  +			B[Tv "in the";
          736  +				R[|T"name";T"sight";T"name and sight";T "great and terrible name";|]];
          737  +			B[T "by the";
          738  +				R[|T"grace";T"power";T"grace and power";T"will";|]];
          739  +		|];
          740  +		Tv "of";
          741  +		R[|
          742  +			T "the Queen"; T "the King"; T "her Majesty the Queen"; T "his Majesty the King";
          743  +			T "all that is holy"; T "justice"; T "God"; T "the Lord"; T "the Sultan"; T "the Caliph";
          744  +			T "the Prince"; T "the Princess"; T "the Realm"; T "the Kingdom"; T "our infernal master";
          745  +			T "Satan"; T "Lucifer"; T "Heaven"; T "the heavens"; T "the Prophet"; T "Yaldabaoth";
          746  +			T "Heaven and all its angels"; T "our Creator"; T "the Maker"; T "the spirits";
          747  +		|];
          748  +		P ",";
          749  +	]);
          750  +	R[|
          751  +		B[court;
          752  +			O(T "hereby");
          753  +			R[| T "finds"; T "declares"; T "proclaims"; T "pronounces"; T "judges"; Tv "adjuges";|];
          754  +		];
          755  +		B[Tv "I";
          756  +			O(T "hereby");
          757  +			R[| T "find"; T "declare"; T "proclaim"; T "pronounce"; T "judge"; Tv "adjudge"|];
          758  +		]
          759  +	|];
          760  +	R[| T "you"; T "the defendant"; T "the accused party";|];
          761  +	T "guilty";
          762  +	O(Tv "on all counts");
          763  +	Tv "of";
          764  +	charge;
          765  +	P".";
          766  +	O(B[
          767  +		R[|imprisonment; reduce; order; banishment; condemnation; T"Get in the Crime Hole";|];
          768  +		P".";
          769  +	]);
          770  +])
          771  +let global = R[|conviction; accusation;|]
          772  +let () = Random.self_init ();
          773  +	print_string
          774  +		(String.trim
          775  +			(flatten
          776  +				(eval global)))

Added drug.ml version [b5c9249601].

            1  +let frics = [| "f"; "sh"; "th"; |]
            2  +let vfrics = [| "z"; "v"; "zh"; |]
            3  +let stops = [| "t"; "p"; "k"; "c"; |]
            4  +let vstops = [| "d"; "b"; "g"; "gh"; |]
            5  +let withglide r f = Array.map (fun i -> i^f) r
            6  +let withonset r o = Array.map (fun i -> o^i) r
            7  +let consonants = Array.concat [
            8  +	frics; vfrics; stops; vstops;
            9  +	withonset stops "s";
           10  +	[| "w"; "r"; "rh"; "s"; "l"; "ch"; "n"; "m"; |];
           11  +]
           12  +let initials = Array.concat [
           13  +	consonants;
           14  +	withglide frics "r"; withglide frics "l"; withglide frics "w";
           15  +	withglide stops "r"; withglide vstops "r"; withglide vstops "w";
           16  +	[| "qu"; "spr"; "spl"; "str"; "scr"; "scl"; "squ"; "bl"; "gl"; "sn"; "sm"; "j"; "h"; "sph"; "ph";|];
           17  +]
           18  +let nuclei = [| "e"; "ee"; "i"; "a"; "ou"; "u"; "oo"; "ea"; "oa"; "ai"; "oi"; "ie";|]
           19  +let finals = Array.concat [
           20  +	vstops;
           21  +	withonset stops "s"; withonset stops "r"; withonset stops "l";
           22  +	withonset vstops "r"; withonset vstops "l";
           23  +	[| "gh"; "ck"; "ce"; "ss"; "se"; "nd"; "mb"; "mph"; "nk"; "tch"; "ke"; "ght";
           24  +	"ff";  "ll"; "zz"; "t"; "p"; "th"; "rth"; "lth"; "dge"; "nge"; "ng"; "ft"; "ckle"; "ngle"; "rkle";
           25  +	"scht"; "ze"; "x"; "sh"; "rsh"; "lsh"; "ggle"; "ddle"; "bble"; "pple"; "rge"; "lge"; "ve"; "rve";
           26  +	"lve"; "ffle"; "ttle"; "kle"; "sch"; "m"; "n"; "rm"; "lm"; "rn"; "ln";|]
           27  +]
           28  +let range min max = (Random.int (max-min)) + min
           29  +let chance n = range 0 n = 0
           30  +let pick (r: 'a array) : 'a = r.(range 0 (Array.length r));;
           31  +let prefixes = [| "crack"; "crystal"; "powdered"; "raw"; "pure"; "liquid"; "street";
           32  +	"super"; "electric"; "diced"; "homemade"; "traditional"; "old-school"; "purified";
           33  +	"high-caliber"; "high-octane"; "old-fashioned"; "good old"; "honest-to-god";
           34  +	"weapons-grade"; "soviet"; "american"; "canadian"; "british"; "russian";
           35  +	"synthetic"; "french"; "cyber"; |]
           36  +let word () = (if chance 3 then (pick prefixes) ^ " " else "") ^
           37  +	(if chance 5 then "" else pick initials) ^
           38  +	(pick nuclei) ^
           39  +	(pick finals)
           40  +	
           41  +let greets = [| "hey"; "whassup"; "what's up"; "what up"; "yo"; "hey there"; "what's shakin'" |]
           42  +let names = [| "dude"; "bro"; "man"; "babe"; "sweetheart"; "honey"; "baby"; "hottie"; "girl"; |]
           43  +let questions = [| "wanna"; "want to"; "shall we"; "how about we"; |]
           44  +let exhorts = [| "we oughta"; "you oughta"; "we ought to"; "you ought to"; "we should";
           45  +	"you should"; "let's"; |]
           46  +type component = Invariant of string | Numbered of string * string | Poss
           47  +type state = Plain of string | Compound of component list
           48  +let states = [|
           49  +	Plain "high";
           50  +	Compound[Invariant "out of"; Poss; Numbered("mind","minds")];
           51  +	Compound[Invariant "outta"; Poss; Numbered("mind","minds")];
           52  +	Plain "fucked up";
           53  +	Plain "wrecked";
           54  +	Plain "hammered";
           55  +	Plain "buzzed";
           56  +	Plain "tweaked";
           57  +	Plain "whacked";
           58  +	Plain "whacked out";
           59  +	Plain "smacked";
           60  +	Plain "smacked out";
           61  +	Plain "tipsy";
           62  +	Plain "snazzy";
           63  +	Plain "spooky";
           64  +	Plain "crazy";
           65  +	Plain "messed up";
           66  +	Plain "far out";
           67  +	Plain "horny";
           68  +	Plain "psycho";
           69  +	Plain "loony";
           70  +	Plain "wacky";
           71  +	Plain "silly";
           72  +	Plain "creepy";
           73  +	Plain "frazzled";
           74  +	Plain "dazzling";
           75  +	Plain "wired";
           76  +	Plain "peppy";
           77  +	Plain "hoovered";
           78  +	Plain "turnt";
           79  +	Plain "turnt up";
           80  +	Plain "tits-up";
           81  +	Plain "toasted";
           82  +	Plain "roasted";
           83  +	Plain "cooked";
           84  +	Plain "baked";
           85  +	Plain "basted";
           86  +	Plain "flunked";
           87  +	Plain "flunked out";
           88  +	Plain "crazed";
           89  +	Plain "stewed";
           90  +	Plain "framed for war crimes";
           91  +	Plain "ruined";
           92  +	Plain "totally ruined";
           93  +	Plain "whacked out";
           94  +	Plain "creeped out";
           95  +	Plain "spunky";
           96  +	Plain "spiffy";
           97  +	Plain "nifty";
           98  +	Plain "wicked";
           99  +	Plain "slutty";
          100  +	Plain "jazzed";
          101  +	Plain "jazzy";
          102  +	Plain "fried";
          103  +	Plain "hecked";
          104  +	Plain "hecked up";
          105  +	Plain "hecked out";
          106  +	Plain "screwed";
          107  +	Plain "screwed up";
          108  +	Plain "ousted";
          109  +	Plain "thrown out of the mall";
          110  +	Plain "cyber";
          111  +	Plain "totally online";
          112  +	Plain "cybered";
          113  +	Plain "downloaded";
          114  +|]
          115  +let roas = [| "on"; "shooting up"; "using"; "mainlining"; "snorting"; "vaping"; "smoking"; "cybering";
          116  +	"sucking down"; "gargling"; "doing"; "trying"; "guzzling"; "popping"; "downing"; "chewing"; 
          117  +	"crunching"; "sniffing"; "zapping"; "downloading"; "dropping"; "cooking up"; "freebasing"|]
          118  +let vroas = [| "shoot up"; "mainline"; "snort"; "vape"; "smoke"; "freebase";
          119  +	"suck down"; "gargle"; "do"; "try"; "guzzle"; "pop"; "down"; "chew"; "crunch";
          120  +	"sniff"; "zap"; "download"; "drop"; "cyber"; "cook up"; |]
          121  +module Pronoun = struct
          122  +	type t = {
          123  +		nom : string; obl : string; gen : string;
          124  +		refl : string; cop : string; brevcop : string;
          125  +		pl : bool;
          126  +	}
          127  +	let you = {nom = "you"; obl = "you"; gen = "your"; refl = "yourself";
          128  +		cop = "are"; brevcop = "'re"; pl = false;}
          129  +	let youpl = {nom = "you"; obl = "you"; gen = "your"; refl = "yourself";
          130  +		cop = "are"; brevcop = "'re"; pl = true;}
          131  +	let he = {nom = "he"; obl = "him"; gen = "his"; refl = "himself";
          132  +		cop = "is"; brevcop = "'s"; pl = false;}
          133  +	let they = {nom = "they"; obl = "them"; gen = "their"; refl = "themselves";
          134  +		cop = "are"; brevcop = "'re"; pl = true;}
          135  +	let she = {nom = "she"; obl = "her"; gen = "her"; refl = "herself";
          136  +		cop = "is"; brevcop = "'s"; pl = false;}
          137  +	let me = {nom = "I"; obl = "me"; gen = "my"; refl = "myself";
          138  +		cop = "am"; brevcop = "'m"; pl = false;}
          139  +	let we = {nom = "we"; obl = "us"; gen = "our"; refl = "ourselves";
          140  +		cop = "are"; brevcop = "'re"; pl = true;}
          141  +	let all = [| you; youpl; he; they; she; me; we |]
          142  +end
          143  +let cop p = Pronoun.(if chance 4 then p.nom ^ " " ^ p.cop else p.nom^p.brevcop)
          144  +let makestate p s = 
          145  +	let eval c = match c with
          146  +		| Invariant i -> i
          147  +		| Numbered(sg,pl) -> if p.Pronoun.pl then pl else sg
          148  +		| Poss -> p.Pronoun.gen
          149  +	in match s with
          150  +		| Plain t -> t
          151  +		| Compound l -> List.fold_left (fun a t -> if a = "" then a^(eval t) else a^" "^(eval t)) "" l 
          152  +let gethigh p = (cop p) ^ (pick [|" getting "; " gonna get "; " "|]) ^ (pick [|"";"so "|])
          153  +	^ (makestate p (pick states)) ^ " on " ^ (word ());;
          154  +let cantwait p = p.Pronoun.nom ^ " can't wait to get " ^ (makestate p (pick states)) ^ " on " ^ (word ());;
          155  +let affecting p =
          156  +	if chance 2 then 
          157  +		(pick [|
          158  +			"it's got"; "it's getting"; "it got"; "it has";
          159  +			"it's making"; "it's gonna get"; "it's gonna make"
          160  +		|]) ^ " " ^ p.Pronoun.obl
          161  +	else Pronoun.(pick [|
          162  +		p.nom ^ " got";
          163  +		(cop p) ^ " getting";
          164  +		(cop p) ^ " gonna get";
          165  +		(cop p);
          166  +	|]);;
          167  +let gotso p = (affecting p) ^ (pick [|" ";" so "|]) ^ (makestate p (pick states));;
          168  +let ison p = (cop p) ^ " " ^ (pick roas) ^ " " ^ (pick [|"so much ";"too much ";"way too much ";"a lotta ";"a lot of "; "a ton of "; "a whole lotta "; "a whole lot of ";"";""|]) ^ (word ());;
          169  +let isonand p = (ison p) ^ " and " ^ (gotso p)
          170  +
          171  +let offer p name (* haaaack *) = (pick greets) ^ " " ^ name ^ (pick [|"! "; ", "; ". "; " - ";|]) ^
          172  +	if chance 2 then
          173  +		(pick questions) ^ (pick [|" go "; " "|]) ^ (pick vroas) ^ (pick [|" some "; " "|]) ^
          174  +		(word ()) ^ (if chance 2 then " and get " ^ (makestate p (pick states)) else "") ^ "?"
          175  +	else  
          176  +		(pick exhorts) ^ (pick [|" go "; " "|]) ^ (pick vroas) ^ (pick [|" some "; " "|]) ^
          177  +		(word ()) ^ (if chance 2 then " and get " ^ (makestate p (pick states)) else "") ^
          178  +		(pick [|"!";"";"."|]);;
          179  +let offer_wrap p (* haaaack *) = offer Pronoun.you (pick names) 
          180  +let gotsoand p = (gotso p) ^ " " ^ (pick roas) ^ (pick [|" the "; " that "; " all that ";" some ";|]) ^ (word ())
          181  +let routes = [| gethigh; ison; isonand; offer_wrap; gotsoand; cantwait; |] 
          182  +let main = Random.self_init ();
          183  +	if Array.length Sys.argv >= 2 && String.length (String.trim (Sys.argv.(1))) >= 1 then
          184  +		print_string(offer Pronoun.you (String.trim Sys.argv.(1)))
          185  +	else print_string (pick routes (pick Pronoun.all))

Added dx.ml version [a7d9e1eab3].

            1  +let range min max = (Random.int (max-min)) + min
            2  +let chance n = range 0 n = 0
            3  +let pick (r: 'a array) : 'a = r.(range 0 (Array.length r));;
            4  +
            5  +let prefixes = [|
            6  +    "anarcho"; "diabolo"; "psycho"; "neuro"; "socio"; "ego"; "mesmo";
            7  +|]
            8  +let suffixes = [|
            9  +    "phrenia"; "pathy"; "sis"; "tism"; "clasm";
           10  +|]
           11  +let adjs = [|
           12  +    "eboulliant"; "gangrenous"; "hysterical"; "malicious"; "diabolical"; "injunctive"; "gregarious"; "apocalyptic"; "felonious"; "oppositional"; "defiant"; "dextrous"; "harmonious"; "disharmonious"; "defective"; "reactive"; "magnificent"; "misogynistic"; "egalitarian"; "paraphilic"; "deviant"; "subjunctive"; "indicative"; "optative"; "jussive"; "judicial"; "precarious"; "disjunctive"; "redactive"; "[REDACTED]"; "criminal"; "illegal"; "psychotic"; "delusional"; "lawful"; "unlawful"; "inferior"; "superior"; "psychotic"; "histrionic"; "borderline"; "schizoid"; "theoretic"; "theoretical"; "Marxist"; "Leninist"; "Chomskyite"; "selective"; "clinical"; "sub-clinical"; "dominant"; "latent"; "submissive"; "orgasmic"; "orgiastic"; "optimistic"; "pessimistic"; "depressive"; "manic"; "dysfunctional"; "redundant"; "reciprocal"; "reflexive"; "didactic"; "syntonic"; "asymptomatic"; "asymptotic"; "infinite"; "diabetic"; "carcinogenic"; "diabetic"; "adiabatic";
           13  +|]
           14  +let parts = [| 
           15  +    "ego"; "id"; "superego"; "posterior"; "hindbrain"; "forebrain"; "forehead"; "kidney"; "appendix"; "elbow"; "intestinal tract"; "bile"; "ichor"; "blood";
           16  +|]
           17  +let dtnames = [|
           18  +    "kreutz"; "hammar"; "feld"; "holtz"; "mann"; "eich"; "berger"; "wald"; "grund"; "weiss"; "schmerz"; "welt"; "sturm"; "blitz"; "reich"; "blitzen"; "brauch"; "ratten"; "huber"; "bliss"; "blatt"; "gott"; "zeit"; "leute"; "haupt"; "bann"; "eich"; "schaft"; "hund"; "stein"; "pferd"; "wurst"; "brot"; "lauf"; "glück"; "freund"; "feldt"; "stadt"; "dorf"; "bahn"; "euch"; "brandt"; "blut"; "knorpel";
           19  +|]
           20  +let names = [| "Chomsky"; "Marx"; "Lenin"; "Mao"; "Freud"; "Asperger";|]
           21  +let name () = if chance 6 then (pick names) else String.capitalize_ascii ((pick dtnames) ^ (pick dtnames))
           22  +
           23  +let kinds = [|
           24  +    "disorder";
           25  +    "defect";
           26  +    "dysfunction";
           27  +    "personality disorder";
           28  +    "syndrome";
           29  +    "personality defect";
           30  +    "defect";
           31  +    "illness";
           32  +    "psychopathy";
           33  +    "sociopathy";
           34  +    "tendency";
           35  +    "delusion";
           36  +    "hysteria";
           37  +    "psychosis";
           38  +    "neurosis";
           39  +    "dementia";
           40  +    "schizophrenia";
           41  +    "effect";
           42  +    "mutism";
           43  +    "autism";
           44  +    "corruption";
           45  +    "mania";
           46  +|]
           47  +
           48  +
           49  +
           50  +let rec subform () = match range 0 12 with
           51  +    | 0 -> (pick adjs) ^ " " ^ (pick kinds)
           52  +    | 1 -> (pick adjs) ^ "-" ^ (pick adjs) ^ " " ^ (pick kinds)
           53  +    | 2 -> (name ()) ^ " " ^ (pick kinds)
           54  +    | 3 -> (name ()) ^ " " ^ (subform ())
           55  +    | 4 -> (name ()) ^ "-type " ^ (subform ())
           56  +    | 5 -> (subform()) ^ " of the " ^ (pick parts)
           57  +    | 6 -> (pick adjs) ^ " " ^ (subform ())
           58  +    | 7 -> (pick adjs) ^ " " ^ (pick prefixes) ^ (pick suffixes)
           59  +    | 8 -> (pick prefixes) ^ "-" ^ (pick adjs) ^ " " ^ (pick kinds)
           60  +    | 9 -> (pick parts) ^ " " ^ (pick kinds)
           61  +    | 10 -> (name ()) ^ "-" ^ (subform ())
           62  +    | 11 -> (pick parts) ^ "-" ^ (pick adjs) ^ " " ^ (pick kinds)
           63  +    | _ -> assert false
           64  +
           65  +let modifiers = [|
           66  +    "a peculiar case of";
           67  +    "a peculiar form of";
           68  +    "an unusual case of";
           69  +    "an unusual form of";
           70  +    "a remarkable case of";
           71  +    "a remarkable form of";
           72  +|]
           73  +let form () = (if chance 4 then (pick modifiers) ^ " " else "") ^ match range 0 3 with
           74  +    | 0 -> subform ()
           75  +    | 1 -> (name ()) ^ "'s " ^ (subform ())
           76  +    | 2 -> "the " ^ (subform ())
           77  +    | _ -> assert false
           78  +
           79  +let dxs = [|
           80  +    "suffering from";
           81  +    "afflicted by";
           82  +    "displaying";
           83  +    "displaying the characteristics of";
           84  +    "displaying the characteristic behavior of";
           85  +    "crippled by";
           86  +    "under the influence of";
           87  +|]
           88  +let msg () = match (if chance 4 then 0 else range 0 5) with 
           89  +    | 0 -> (pick [|
           90  +        "You appear to be";
           91  +        "You would appear to be";
           92  +        "You seem to be";
           93  +        "You would seem to be";
           94  +        "I can only hypothesize that you are";
           95  +        "You are";
           96  +        "It seems you are";
           97  +        "I can only come to the conclusion that you are";
           98  +        "The only conclusion I can come to is that you are";
           99  +        "I can conclude only that you are";
          100  +        "Clearly, you are";
          101  +        "You are clearly";|]) ^ " " ^ (pick dxs) ^ " " ^ (form())
          102  +    | 1 -> "As clear a case of " ^ (form ()) ^ " as I've ever seen"
          103  +    | 2 -> "Clearly a case of " ^ (form ())
          104  +    | 3 -> "Clearly a sad case of " ^ (form ())
          105  +    | 4 -> "The symptoms are remarkably reminiscent of " ^ (form()) ^ ", as described by " ^ (name()) ^ " in his famous treatise"
          106  +    | 5 -> "The obvious diagnosis is, of course, " ^ (form()) ^ (if chance 2 then ", though I remain skeptical" else "")
          107  +    | _ -> assert false
          108  +
          109  +let () = Random.self_init (); print_string (msg ())

Added egret_txt.ml version [18174bc407].

            1  +type root = R of string | I of string*string
            2  +type kind = Plain | Vowel | Uncountable
            3  +type word = root * kind
            4  +let pick a = a.(Random.int (Array.length a))
            5  +let words = [|
            6  +	(R "egret", Vowel);	(I("knife","knives"), Plain);	(I("child","children"), Plain);
            7  +	(R "owl", Vowel);		(R "dawn", Uncountable);	(R "dawn", Plain);
            8  +	(R "relic", Plain);		(R "home", Plain);				(R "hope", Plain);
            9  +	(R "tower", Plain);	(R "plain", Plain);					(R "fire", Plain);
           10  +	(R "fire", Uncountable);	(R "fear", Plain);			(R "fear", Uncountable);
           11  +	(R "whisper", Plain);		(R "furrow", Plain);			(R "field", Plain);
           12  +	(R "regret", Plain);		(R "blade", Plain);			(R "thing", Plain);
           13  +	(R "pillar", Plain);		(R "fate", Plain);				(R "doom", Plain);
           14  +	(R "candle", Plain);		(R "lantern", Plain);			(I("sky","skies"), Plain);
           15  +	(I("grass","grasses"), Plain);	(I("ash","ashes"), Vowel); (R "void", Plain);
           16  +	(R "stranger", Plain);		(R "blood", Uncountable);	(R "incompetence", Uncountable);
           17  +	(R "holiness", Uncountable);	(R "sorrow", Uncountable);	(R "gladness", Uncountable);
           18  +	(R "unkindness", Uncountable); (I("cruelty","cruelties"), Plain);
           19  +	(R "cruelty", Uncountable); (R "ember", Vowel); (R "throat", Plain);
           20  +|]
           21  +let adjs = [|
           22  +	"sorrowful";"fiery";"unkind";"fallow";"sallow";"hollow";"unending";"wondrous";
           23  +	"vapid";"dim";"shallow";"glorious";"empty";"failing";"dying";"crawling";"ashen";
           24  +	"furious";"frightened";"terrible";"awful";"eternal";"silent";"frightful";"timeless";
           25  +	"golden";"black";"white";"noble";"defunct";
           26  +|]
           27  +let verbs = [|
           28  +	R "burn", true;			R "fear",true;	R "slaughter",true;	R "explode",false;
           29  +	R "interrogate",true;	R "sleep",false;	R "despair",false;		R "dissolve",true;
           30  +	R "question",true;		R "slay",true;	R "stay",false;			R "fade",false;
           31  +	I("wonder at", "wonders at"),true;		R "linger",false;		R "die",false;
           32  +	I("cry out", "cries out"),false; I("cry out at","cries out at"),true;
           33  +	I("cry","cries"),false; R "weep", false;
           34  +	I("cry out to","cries out to"),true;
           35  +|]
           36  +let compl : root array = [| R "hope"; R "believe"; I("wonder if","wonders if"); |];;
           37  +let sg (r:root) : string = match r with
           38  +	| R x -> x
           39  +	| I(x,_) -> x;;
           40  +let pl (r:root) : string = match r with
           41  +	| R x -> x^"s"
           42  +	| I(_,x) -> x;;
           43  +let indef (w:word) : string = let (r,k) = w in (match k with
           44  +	| Plain -> "a "
           45  +	| Uncountable -> ""
           46  +	| Vowel -> "an ") ^ (sg r);;
           47  +	
           48  +let pron () = pick [|
           49  +	"it",false; "she",false; "he",false; "they",true;
           50  +	"we",true; "you",true;
           51  +|]
           52  +let accpron() = pick [|
           53  +	"it";"her";"him";"them";"us"
           54  +|]
           55  +let basenp () : string * bool= let w = pick words in 
           56  +	let (r,k) = w in
           57  +	let adj = pick [|(pick adjs) ^ " ";""|] in
           58  +	let rsg = adj ^ (sg r) in
           59  +	let rpl = adj ^ (pl r) in
           60  +	let sgs = [|
           61  +		indef w;
           62  +		"the " ^ rsg;
           63  +		"yon " ^ rsg;
           64  +		"this " ^ rsg;
           65  +		"that " ^ rsg;
           66  +		"my " ^ rsg;
           67  +		"some " ^ rsg;
           68  +		"your " ^ rsg;
           69  +		"her " ^ rsg;
           70  +		"our " ^ rsg;
           71  +		"its " ^ rsg;
           72  +		"their " ^ rsg;
           73  +		"his " ^ rsg;
           74  +	|] in let pls = [|
           75  +		pl r;
           76  +		"the " ^ rpl;
           77  +		"these " ^ rpl;
           78  +		"those " ^ rpl;
           79  +		"my " ^ rpl;
           80  +		"some " ^ rpl;
           81  +		"yonder " ^ rpl;
           82  +		"your " ^ rpl;
           83  +		"her " ^ rpl;
           84  +		"our " ^ rpl;
           85  +		"its " ^ rpl;
           86  +		"his " ^ rpl;
           87  +		"their " ^ rpl;
           88  +	|] in if k = Uncountable then (pick sgs,false) else pick [|(pick sgs,false);(pick pls,true)|]
           89  +
           90  +let rec gp () : string*bool = let (n,p) = np () in (n ^ " of " ^ (let (n,_) = np() in n)), p
           91  +and relp () : string*bool = let (n,p) = basenp () in (n ^ " that " ^ (vp p)), p
           92  +and np () : string*bool = (pick [| basenp; basenp; basenp; gp; relp |])()
           93  +and pvp p =  let verb, trans = pick verbs in
           94  +				let v = (if p then sg else pl) verb in
           95  +				let n, _ = (pick [| np(); accpron(),false |]) in
           96  +					v ^ if trans then (" " ^ n) else ""
           97  +(* and cvp (p:bool) : string =
           98  +	let verb = (pick compl) in
           99  +	let v = (if p then sg else pl) verb in
          100  +	let n,p = (pick [|np;pron|])() in
          101  +	let d = decl n p in
          102  +	v ^ " " ^ d -- THIS IS HORRIBLY BROKEN *)
          103  +and vp p = pvp p
          104  +and decl n p = n ^ " " ^ (vp p) ^ (pick [|
          105  +	(fun()->".");
          106  +	(fun()->", and " ^ (s()));
          107  +	(fun()->", but " ^ (s()));
          108  +|]())
          109  +and idques n p = let n2, _ = np() in (if p then "are " else "is ")^n^" "^n2^"?"
          110  +and ques n p = (if p then "do " else "does ")^n^" "^(vp true)^"?"
          111  +and s () = let (n,p) = pick [|np;pron|] () in (pick [|decl;decl;ques;idques|]) n p;;
          112  +let rec times x f = if x > 0 then
          113  +		(f (); times (x-1) f)
          114  +	else
          115  +		();;
          116  +(*let () = Random.self_init ();
          117  +	times 10 (fun () -> let c = string_of_int ((Random.int 6)+1) in
          118  +		print_string ("\x1b[1;3"^c^"m-\x1b[0;3"^c^"m "^(s ()) ^ "\n"));;*)
          119  +let () = Random.self_init (); print_string ((s ()) ^ "\n");;

Added lib/bot-cs.scm version [aad6714882].

            1  +(define-macro (rule . body)
            2  +  (define (make-cases ct body acc)
            3  +    (if (eq? body '()) acc
            4  +      (make-cases (+ ct 1) (cdr body)
            5  +		(cons (list (list ct) (cons 'string-append (car body))) acc))))
            6  +  (list 'define (car body)
            7  +	(cons 'case (cons (list 'random (length (cdr body)))
            8  +	  (make-cases 0 (cdr body) '()) ))))
            9  +
           10  +(define {list1}
           11  +	(case (random ct)
           12  +		((0) (string-append {list2}))
           13  +		))
           14  +
           15  +(define (pick ar)
           16  +	(vector-ref ar (random (vector-length ar))))

Added lib/bot-gambit.scm version [254cc82697].

            1  +(define-macro (rule . body)
            2  +  (define (make-cases ct body acc)
            3  +    (if (eq? body '()) acc
            4  +      (make-cases (+ ct 1) (cdr body)
            5  +		(cons (list (list ct) (cons 'string-append (car body))) acc))))
            6  +  (list 'define (car body)
            7  +	(cons 'case (cons (list 'random-integer (length (cdr body)))
            8  +	  (make-cases 0 (cdr body) '()) ))))
            9  +
           10  +(define (pick ar)
           11  +  (vector-ref ar (random-integer (vector-length ar))))
           12  +
           13  +(random-source-randomize! default-random-source)

Added monster.ml version [17f0b8d58f].

            1  +let nouns = [|
            2  +	"verve"; "pulchritude"; "beneficence"; "dismay"; "wit";
            3  +	"cheer"; "glee"; "malevolence"; "wickedness"; "cruelty";
            4  +	"sagacity"; "splendor"; "pride"; "rage"; "fury"; "snazz";
            5  +	"foolishness"; "sleepiness"; "curiosity"; "brevity"; "lust";
            6  +	"confidence"; "bashfulness"; "awkwardness"; "terror";
            7  +	"accuracy"; "insanity"; "sorrow"; "gladness"; "weariness";
            8  +	"depression"; "passion"; "dread"; "popularity"; "vulgarity";
            9  +	"madness"; "compassion";
           10  +|]
           11  +let mods = [|
           12  +	"filled"; "overcome"; "shining"; "vivacious";
           13  +	"burning"; "blazing"; "morose"; "gleeful"; "mad";
           14  +	"shaking"; "howling"; "snarling"; "gruesome";
           15  +	"helpless"; "vibrant"; "desperate";
           16  +|]
           17  +let advs = [|
           18  +	"cruelly"; "angrily"; "madly"; "hopelessly"; "thoughtlessly";
           19  +	"wickedly"; "hopefully"; "quickly"; "speedily"; "furiously";
           20  +	"kindly"; "maniacally"; "tearfully"; "bashfully"; "angrily";
           21  +	"wondrously"; "splendidly"; "tremendously"; "badly";
           22  +	"terribly"; "foolishly"; "snazzily"; "toplessly"; "balefully";
           23  +	"beautifully"; "kindly"; "thoughtfully"; "cautiously";
           24  +	"severely"; "wisely";
           25  +|]
           26  +let adjs = [|
           27  +	"cheerful"; "wondrous"; "overwhelming"; "adorable";
           28  +	"snazzy"; "hopeful"; "desperate"; "lustful"; "dour";
           29  +	"sad"; "sorrowful"; "hopeless"; "all-consuming"; "mad";
           30  +	"cruel"; "dreadful"; "terrible"; "fearsome"; "inescapable";
           31  +	"thoughtless"; "vile"; "bashful"; "topless"; "naked"; "dire";
           32  +	"baleful"; "vulgar"; "beautiful"; "horrid"; "cautious";
           33  +	"violent"; "wise"; "supreme"; "marvelous";
           34  +|]
           35  +let verbs = [|
           36  +	"shines"; "toots"; "honks"; "mutters"; "whispers"; "growls";
           37  +	"roars"; "whuffles"; "warbles"; "howls"; "screams"; "shrieks";
           38  +	"quivers"; "dances"; "hops up and down"; "grins"; "mumbles";
           39  +	"counsels you"; "glares"; "stares at you"; "looks up"; "gazes at you";
           40  +	"marvels"; "laughs";
           41  +|]
           42  +
           43  +let pick a = a.(Random.int (Array.length a))
           44  +type rule = R of string array | S of string | B of rule list | A of rule array | O of rule;;
           45  +let rec eval r : string = match r with
           46  +	| R x -> pick x
           47  +	| S x -> x
           48  +	| B x -> List.fold_left (^) "" (List.map eval x)
           49  +	| A x -> eval (pick x)
           50  +	| O x -> if Random.int 2 = 0 then eval x else ""
           51  +let syl () =
           52  +	let stop = R [| "p"; "t"; "k"; |] in
           53  +	let fric = R [| "s"; "f"; "h"; "x"; |] in
           54  +	let vstop = R [| "b"; "d"; "g"; |] in
           55  +	let vfric = R [| "z"; "v"; "gh"; |] in
           56  +	let liq = R [| "l"; "r"; "y"; "w"; |] in
           57  +	let nasal = R [| "n"; "m"; "ng"; |] in
           58  +	let obs = A [| stop; fric; vstop; nasal; liq; |] in
           59  +	let v = R [| "a"; "e"; "u"; "o"; "i"; "ee"; "oo"; "au"; "ai";"oi";|] in
           60  +	let sr = A [|
           61  +		B[obs; v; O obs];
           62  +		B[A [|stop;vstop;fric;vfric;|]; O liq; v; O obs];
           63  +	|] in eval sr
           64  +	;;
           65  +let prefixes = [| "ur-"; "dire "; "dire ur-"; "super " |]
           66  +let name () =
           67  +	let size = 1 + (Random.int 3) in
           68  +	let rec loop n acc = if n = 0 then acc else loop (n-1) (acc^(syl ())) in
           69  +	(if Random.int 2 = 0 then (pick prefixes) else "") ^ loop size "";;
           70  +
           71  +let isvowel c = match c with
           72  +	| 'a' | 'e' | 'i' | 'o' | 'u' -> true
           73  +	| _ -> false;;
           74  +let indef x = if isvowel x.[0] then "an "^x else "a "^x;;
           75  +let encounter () = 
           76  +	let msgs = [|
           77  +		"you encounter";
           78  +		"you chance upon";
           79  +		"you find";
           80  +		"you run into";
           81  +		"you run straight into";
           82  +		"you trip over";
           83  +		"you stumble upon";
           84  +		"you happen upon";
           85  +		"egads!";
           86  +		"how wondrous!";
           87  +		"how marvelous!";
           88  +		"how gruesome!";
           89  +		"how splendid!";
           90  +		"oh no!";
           91  +	|] in
           92  +	let kinds = B [
           93  +			R [|"it";"she";"he";|]; S" ";
           94  +			A [|
           95  +				B[ R verbs; S " ";
           96  +					A [|
           97  +						B[ S "with "; O(B[R adjs; S" "]); R nouns;];
           98  +						R advs;
           99  +					|];
          100  +				];
          101  +				B[S"is "; O(B[R advs;S" ";]); R mods;
          102  +					O(B[ S " with "; O(B[R adjs; S" "]); R nouns;]);
          103  +				];
          104  +			|];
          105  +			S "!"; 
          106  +	] in
          107  +	(pick msgs)^" "^(indef (name()))^"! " ^ (eval kinds);;
          108  +	
          109  +let rec times n a = if n = 0 then () else (a (); times (n-1) a);;
          110  +let () = Random.self_init (); 
          111  +(*	times 20 (fun () ->*)
          112  +		print_string ((encounter ()) ^ "\n")
          113  +(*	)*)

Added namegen.c version [0fd8e31656].

            1  +// No dependencies, just compile with "cc namegen.c -o namegen"
            2  +// replacing cc with your compiler of choice!
            3  +
            4  +#include <stdio.h>
            5  +#include <stdlib.h>
            6  +#include <string.h>
            7  +#include <time.h>
            8  +#include <stdbool.h> 
            9  +
           10  +struct nametype {
           11  +	const char* name;
           12  +    size_t nouns, adjs, gens;
           13  +	bool default_article;
           14  +	size_t maxadj_n, maxadj_g, minadj_n, minadj_g;
           15  +    const char* names[];
           16  +};
           17  + 
           18  +struct nametype conspiracy = { "Conspiracy",
           19  +    18,76,72,true,
           20  +	3,3,0,0, {   // the horrible data structure here is so that we can keep everything
           21  +    //NOUNS         pertaining to the nametype in one place. I wish there were a better way.
           22  +        "Order", "Cult", "Temple", "Church", "Hand", "Eyes",
           23  +        "Source", "Keepers", "Maidens", "Servants", "Templars",
           24  +		"Followers", "Celebrants", "Rite", "Sect", "Guild",
           25  +		"Society", "School",
           26  +       
           27  +    //ADJECTIVES
           28  +        "Sanctified", "Blasphemous", "Red", "Yellow", "Ebon",
           29  +        "Ochre", "Eternal", "Perpetual", "Everlasting", "Black",
           30  +        "White", "Infinite", "Timeless", "Mad", "Terrible", "Sightless",
           31  +		"All-Seeing", "Third", "Second", "Endless", "Reviled",
           32  +		"Absolute", "Damned", "Cursed", "Blessed", "Lucid",
           33  +		"Unthinkable", "Nameless", "Unspeakable", "Glorious",
           34  +		"Cold", "Burning", "Shapeless", "Unknowable", "Lifeless",
           35  +		"Fatal", "Infernal", "Celestial", "Implacable", "Eldritch",
           36  +		"Dark", "Resolute", "Resplendant", "Unstoppable", "Blood-Soaked",
           37  +		"Endless", "Forgotten", "Iron", "Secret", "Hidden", "Fiery",
           38  +		"Ancient", "Silver", "Screaming", "Mighty", "Thousand-Year",
           39  +		"Jewelled", "Damnable", "Creeping", "All-Knowing",
           40  +		"All-Hearing", "Holy", "Global", "Leering", "Forty-Second",
           41  +		"Divine", "Faithful", "Ageless", "Steadfast", "Cruel",
           42  +		"Sapphire", "Sapphic", "Secluded", "Scarlet", "Shrieking",
           43  +		"Hollow",
           44  +       
           45  +    //GENS
           46  +        "Prince", "King", "Master", "Princess", "Queen", "Mistress",
           47  +        "Devourer", "Obliterator", "Destroyer", "0Doom", "0Death",  // this is extremely hacky
           48  +        "0Torment", "Serpent", "Moon", "One", "Two", "Three", "Four",
           49  +        "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Twelve",       //there is nothing menacing about the number 11
           50  +		"Eye", "God", "Horror", "Thing", "Flames", "Night", "Day",
           51  +		"Year", "Years", "Way", "Realm", "Path", "Light", "Fire",
           52  +		"Door", "Gate", "Plan", "Terror", "0Pain", "0Screams",
           53  +		"Road", "Spire", "Beast", "Flesh", "Sword", "Mountain",
           54  +		"River","Crown","Scepter","0Fires","Desecrator","Defiler",
           55  +		"Despoiler", "Ravager", "Rite", "Sea", "Ocean", "Chaos",
           56  +		"Goat", "Legion", "Pyramid", "Dragon", "Hand", "Pantheon",
           57  +		"Spirit", "Devil", "Gods",
           58  +    }
           59  +};
           60  + 
           61  +struct nametype government = { "Government",
           62  +	10,29,64,false,
           63  +	3,3,0,0, {
           64  +	//NOUNS
           65  +		"Kingdom", "Empire", "Republic", "Principality", "Federation",
           66  +		"State", "States", "Confederacy", "Powers", "Duchy",
           67  +
           68  +	//ADJECTIVES
           69  +		"United", "Confederated", "Allied", "Unified", "Collective",
           70  +		"Democratic", "Republican", "Federated", "Glorious", "People's",
           71  +		"Socialist", "Soviet", "New", "Old", "Equatorial", "North",
           72  +		"South", "West", "East", "Southwest", "Northwest", "Northeast",
           73  +		"Southeast", "Great", "Superior", "Mostly Harmless", "Grand",
           74  +		"Nuclear", "Imperial",
           75  +
           76  +	//GENS
           77  +		"America", "France", "Spain", "Megaspain", "Hyperfrance",
           78  +		"Space America", "Space France", "Arabia", "New Arabia",
           79  +		"Jersey", "Zealand", "York", "Manchester", "Britain",
           80  +		"Sloravia", "Azmenistan", "Arkansas", "Ruritania", "Kundu",
           81  +		"Earth", "Mars", "Pluto", "Kansas", "Nebtratucky", "Arkantucky",
           82  +		"Nebrahoma", "New Mexigon", "Hawaishington", "Qurac", "Persia",
           83  +		"Nevadakota", "Missisota", "Minnesippi", "Montanabraska",
           84  +		"Wyomissouri", "New Hampchigan", "Delachusetts", "Arkantexas",
           85  +		"Kentexas", "Bumbelch", "Nebravada", "Tennessaw", "Connectican't",
           86  +		"Oklatucky", "Oklabama", "Canuckistan",
           87  +
           88  +		"Russia", "Scotland", "Tanzania", "Ireland", "Togo", "Taiwan",
           89  +		"Syria", "Senegal", "Serbia", "Paraguay", "Norway", "Korea",
           90  +		"Poland", "Smop",
           91  +
           92  +		"Warsaw", "London", "Moscow", "Rome",
           93  +		
           94  +		"Goat",
           95  +	}
           96  +};
           97  +
           98  +const struct nametype* alltypes[] = {&conspiracy, &government};
           99  +
          100  +char* gen_name(const struct nametype* t) {
          101  +        size_t length=0;
          102  +       
          103  +        const char* noun = t->names[rand()%t->nouns];
          104  +        length=strlen(noun)+3;
          105  +		bool swaparticle;
          106  +        const char* gen = t->names[t->nouns + t->adjs + rand()%t->gens];
          107  +		if (gen[0]=='0') swaparticle=true, gen++; else swaparticle=false;
          108  +		if ((t->default_article && !swaparticle) || (!t->default_article && swaparticle)) {
          109  +			length+=4;
          110  +		}
          111  +        length+=strlen(gen)+1;
          112  +       
          113  + 
          114  +        size_t adjc_n = rand() % (t->maxadj_n-t->minadj_n+1) + t->minadj_n;
          115  +        size_t adjc_o = rand() % (t->maxadj_g-t->minadj_g+1) + t->minadj_g;
          116  +       
          117  +        const char** adjs_n = malloc(sizeof(size_t) * adjc_n);
          118  +        for (unsigned char i = 0; i<adjc_n; i++) {
          119  +                adjs_n[i] = t->names[t->nouns + rand()%t->adjs];
          120  +                length+=strlen(adjs_n[i])+1;
          121  +        } // ouch
          122  +       
          123  +        const char** adjs_o = malloc(sizeof(size_t) * adjc_o);
          124  +        for (unsigned char i = 0; i<adjc_o; i++) {
          125  +                adjs_o[i] = t->names[t->nouns + rand()%t->adjs];
          126  +                length+=strlen(adjs_o[i])+1;
          127  +        }
          128  +       
          129  +        char* name = malloc(length+1);
          130  +        name[0] = 0; //herp a derp were there some weird errors without this
          131  +        //strcat you are fucking evil
          132  +        for (size_t i = 0; i<adjc_n; i++) {
          133  +                strcat(name, adjs_n[i]);
          134  +                strcat(name, " ");
          135  +        }
          136  +        strcat(name, noun);
          137  +        strcat(name, " of ");
          138  +		if ((t->default_article && !swaparticle) || (!t->default_article && swaparticle)) strcat (name, "the ");
          139  +        for (size_t i = 0; i<adjc_o; i++) {
          140  +                strcat(name, adjs_o[i]);
          141  +                strcat(name, " ");
          142  +        }
          143  +        strcat(name, gen);
          144  +        
          145  +        free(adjs_o);
          146  +        free(adjs_n);
          147  +        return name;
          148  +}
          149  + 
          150  +int main() {
          151  +        srand(time(NULL));
          152  +		for (int c=0;c<sizeof(alltypes)/sizeof(struct nametype*);c++) {
          153  +	        for (int i=0;i<10;i++) {
          154  +                char* name = gen_name(alltypes[c]);
          155  +                printf("\x1b[1m%s %d:\x1b[0m The %s\n",alltypes[c]->name,i,name);
          156  +                free(name);
          157  +	        }
          158  +			putchar('\n');
          159  +		}
          160  +        return 0;
          161  +}

Added orderbot.ml version [d9583c873c].

            1  +let verbs = [|
            2  +	"repel"; "assail"; "bugger"; "degauss"; "murder";
            3  +	"slay"; "abort"; "avenge"; "fuck"; "defile"; "devour";
            4  +	"slaughter"; "spoil"; "eat"; "spank"; "seize"; "respect";
            5  +	"sacrifice"; "return"; "pursue"; "deny"; "purchase"; "buy";
            6  +	"inspect"; "despoil"; "censure"; "flog"; "elect"; "summon";
            7  +	"oust"; "expel"; "extirpate"; "hire"; "fire"; "assassinate";
            8  +	"torture"; "extract"; "rescue"; "incite"; "rouse"; "arouse";
            9  +	"eliminate"; "arrest"; "kidnap"; "confine"; "condemn";
           10  +	"import"; "export"; "exclude"; "make out with"; "kiss";
           11  +	"slap"; "punch"; "whip"; "evict"; "install"; "isolate";
           12  +	"compile"; "gather"; "banish"; "exile"; "defeat"; "battle";
           13  +	"alert"; "go after"; "track down"; "hunt down"; "locate";
           14  +	"find"; "transport"; "tolerate"; "impede"; "incinerate";
           15  +	"defend"; "impale"; "demoralize"; "pleasure"; "bomb";
           16  +	"lay waste to"; "raze"; "inspire"; "worship"; "exalt";
           17  +	"repair"; "rectify"; "duplicate"; "clone"; "avert"; "prevent";
           18  +	"pervert"; "cast out"; "throw down"; "bang"; "screw"; "do";
           19  +	"enslave"; "butcher"; "download"; "upload"; "kill"; "eradicate";
           20  +	"fight"; "stab"; "cut"; "steal"; "lacerate"; "chew"; "digest";
           21  +	"impound"; "impanel"; "gnaw on"; "respect";
           22  +|]
           23  +
           24  +let adjs = [|
           25  +	"sleeping"; "thoughtful"; "insipid"; "thoughtless"; "wretched";
           26  +	"wrathful"; "Republican"; "Democratic"; "royal"; "earnest";
           27  +	"imperial"; "American"; "inspired"; "immoral"; "wistful"; "wondrous";
           28  +	"cheerful"; "giggling"; "wonderful"; "angry"; "silly"; "desperate";
           29  +	"warped"; "rotting"; "rancid"; "raging"; "cool"; "clever";
           30  +	"sneering"; "eternal"; "timeless"; "ancient"; "indecent"; "delightful";
           31  +	"scented"; "sexy"; "hot"; "arousing"; "rampant"; "randy"; "evil";
           32  +	"sacred"; "holy"; "satanic"; "unholy"; "blasphemous"; "repellent";
           33  +	"repulsive"; "fucking"; "worthless"; "grotesque"; "weeping";
           34  +	"goddamn"; "rebellious"; "revolutionary"; "young"; "national";
           35  +	"federal"; "government"; "presidential"; "international"; "public";
           36  +	"current"; "medical"; "fascist"; "buxom"; "apocalyptic";
           37  +	"boastful"; "boring"; "effulgent"; "exuberant"; "lugubrious";
           38  +	"noisome"; "German"; "germanic"; "cloned"; "perverted"; "fanatic";
           39  +	"arrogant"; "magic"; "magical"; "slutty"; "orgasmic"; "obedient";
           40  +	"frantic"; "wandering"; "exalted"; "luminous"; "towering";
           41  +	"little"; "communist"; "socialist"; "neoliberal"; "master's";
           42  +	"grand";
           43  +|]
           44  +
           45  +type noun = R of string | M of string | I of string * string | P of string
           46  +let nouns = [|
           47  +	R "spanner"; R "clown"; R "beetle"; R "candidate"; R "asshole";
           48  +	R "queen"; R "king"; R "advisor"; R "sausage"; M "garbage";
           49  +	R "book"; I("cockroach","cockroaches"); R "virgin"; I("clitoris","clitorises");
           50  +	R "parking lot"; R "parking space"; R "coin meter"; R "car";
           51  +	R "burglar"; I("sheep","sheep"); R "bear"; M "rabble";
           52  +	R "burger"; R "waterfall"; R "hammer"; R "doorknob";
           53  +	R "pig"; R "cop"; R "bagel"; R "mayor"; R "president";
           54  +	R "detective"; R "inquisitor"; M "police"; R "teen";
           55  +	R "mustache"; R "heterosexual"; P "Inquisition"; R "general";
           56  +	I("titty","titties"); R "monkey"; I("empress","empresses"); R "emperor";
           57  +	R "dowager"; R "elixir"; R "cipher"; R "code"; R "secret";
           58  +	M "heterosexuality"; R "dudebro"; P "opposition"; I("cactus","cacti");
           59  +	R "candelabra"; I("furry","furries"); P "gays"; P "spawn"; I("roach","roaches");
           60  +	P "debt"; M "indecency"; R "waste"; M "yaoi"; R "American"; R "Russian";
           61  +	R "German"; R "fascist"; M "software"; R "pigeon"; R "king"; R "mob";
           62  +	P "mafia"; P "apocalypse"; R "clone"; R "pervert"; R "fucker"; R "dude";
           63  +	R "fanatic"; I("army","armies"); R "wall"; R "slut"; I("sorceress","sorceresses");
           64  +	R "sorcerer"; R "mage"; I("elf","elves"); I("industry","industries");
           65  +	R "orgasm"; R "bastard"; R "cult"; R "volunteer"; I("knife","knives");
           66  +	R "spire"; I("mistress","mistresses"); R "master"; R "communist"; R "socialist";
           67  +	R "conservative"; R "liberal"; I("volcano","volcanoes"); P "means of production";
           68  +	I("jury","juries"); R"imperative";
           69  +|]
           70  +
           71  +let ppl = [|
           72  +	"asshole"; "jackass"; "mom"; "dad"; "mommy"; "daddy"; "granny";
           73  +	"auntie"; "senator"; "general"; "captain"; "ma'am"; "sir"; "your majesty";
           74  +	"milady"; "milord"; "sire"; "soldier"; "private"; "fool"; "you fool";
           75  +	"you idiots"; "girls"; "ladies"; "boys"; "men"; "folks"; "minister";
           76  +	"prime minister"; "mayor"; "inquisitor";
           77  +|]
           78  +let isVowel (x:char) : bool = List.mem x ['a';'e';'i';'o';'u';'A';'E';'I';'O';'U']
           79  +type articles = Definite | Indefinite | Zero
           80  +let rand a = a.(Random.int(Array.length a))
           81  +let np () : string = if (Random.int 5) == 0 then
           82  +		rand [|"me";"yourself";"her";"him";"them"|]
           83  +	else let n, art = match rand nouns with
           84  +		| R s -> rand [|
           85  +			s, rand [|Definite;Indefinite|];
           86  +			s^"s", rand [|Definite;Zero|];
           87  +		|]
           88  +		| I(s,p) -> rand [|
           89  +			s, rand [|Definite;Indefinite|];
           90  +			p, rand [|Definite;Zero|];
           91  +		|]
           92  +		| P x -> x, Definite
           93  +		| M x -> x, rand [|Definite;Zero|] in
           94  +	let sp = rand [|n; (rand adjs)^" "^n|] in match art with
           95  +		| Definite -> "the " ^ sp
           96  +		| Indefinite -> (if isVowel sp.[0] then "an " else "a ") ^ sp
           97  +		| Zero -> sp
           98  +
           99  +type seqe = T of string | S | A of string array | F of (unit -> string) | R of seqe array | O of seqe | B of seqe list
          100  +let syntax = B [A verbs; S; F np;]
          101  +let seqs = R [|
          102  +	B[syntax; R[|
          103  +		B[T ". that is an order, "; A ppl;];
          104  +		B[T ", "; A ppl];
          105  +		B[T ", "; A ppl; T ". that is an order"];
          106  +	|]; R[| T "."; T "!"; |];];
          107  +	B[O(T"i command you, "); A ppl; T ", "; syntax; R[|
          108  +		T ".";
          109  +		T ". that is an order!";
          110  +		T ". it is the only option.";
          111  +		T ". and god help us all.";
          112  +		T ". otherwise, we're dead.";
          113  +		T " or die trying.";
          114  +		T "! now!";
          115  +	|];];
          116  +	B[
          117  +		O(T"it is imperative that you "); syntax;
          118  +		O(T " or die trying"); O(B[T", ";A ppl]); R[|
          119  +		T ".";
          120  +		T ". it is the only option.";
          121  +		T ". otherwise, god help us all.";
          122  +		T ". otherwise, we're dead.";
          123  +	|];];
          124  +	B[T "this is your last chance, "; A ppl; T ". "; syntax; O(R[|
          125  +			T " or you're a dead man";
          126  +			T " or you're a dead woman";
          127  +			T " or else";
          128  +			T " or you find out what we do to people who screw us";
          129  +			T " or we go after your family";
          130  +		|]); T ".";
          131  +	];
          132  +	B[ R[|
          133  +		T "you shouldn't ";
          134  +		T "you mustn't ";
          135  +		T "don't ";
          136  +		T "we mustn't ";
          137  +		T "we cannot allow you to ";
          138  +	|]; syntax; O(B[T ", "; A ppl]); T ".";];
          139  +	B[syntax; O(B[T ", "; A ppl]); T ", and to hell with the consequences!"];
          140  +	B[T "man up and "; syntax; O(B[T ", "; A ppl]); T "."];
          141  +	B[syntax; O(B[T ", "; A ppl]); T ", and face your death like a man!"];
          142  +	B[T "we're dead anyway, we might as well ";syntax;T".";];
          143  +	B[T "you're dead anyway, you might as well ";syntax;T".";];
          144  +|]
          145  +(* val eval : seqe -> string *)
          146  +let rec eval s = match s with
          147  +	| T x -> x
          148  +	| S -> " "
          149  +	| A arr -> rand arr
          150  +	| F f -> f ()
          151  +	| R s -> eval (rand s)
          152  +	| B s -> (List.fold_left (^) "" (List.map eval s))
          153  +	| O s -> if Random.int 2 = 0 then eval s else ""
          154  +
          155  +let rec times i x = x (); if i > 0 then times (i-1) x
          156  +let () = Random.self_init();
          157  +	print_string (eval seqs);
          158  +	(* (times 10 (fun () -> print_string ("- "^(eval seqs)^"\n")));; *)
          159  +

Added pharma.ml version [f8230bde94].

            1  +let suffixes = [| "tine"; "zone"; "done"; "dol"; "mycin"; "pentin"; "nine"; "cillin"; "mab"; "xone"; "xine"; "zine"; "dine"; "nyl"; "nil"; "codone"; "morphone"; "drene"; "phine"; "thine"; "toxin"; "xin"; "dioxin"; "lene"; "ne"; "pine"; "relin"; "gen"; "phen"; "fen"; "dem"; "lone"; "fen"; "line"; "but"; "te"; "xate"; "tal"; "mate"; "norphine"; "dal"; "phetamine"; "amphetamine"; "quel"; |]
            2  +let salts = [| "chloride"; "acetate"; "phosphate"; "hydrochloride"; "succinate"; "sulphate"; |]
            3  +let prefixes = [| "neo"; "retro"; "nor"; "tri"; "cycli"; "tetra"; "penta"; "methyl"; "nal"; "pro"; "metha"; "fenta"; "meta"; "hydro"; "fluoro"; "thieno"; "mal"; "eroto"; "diablo"; "miso"; "propy"; "ethy"; "buta"; "hexa"; "benzo"; "piperi"; "sado"; "maso"; "philo"; "theo"; "iso"; "cyclo"; "klepto"; "pyro"; "carba"; "ibu"; "masculo"; "phos"; "estro"; "endo"; "poly"; "bi"; "tri"; "cumulo"; "strato"; "dextro"; "sinistro"; "levo"; "dextra"; "sinistra"; "ecto"; "myco"; "canna"; "am"; |]
            4  +let onsets = [| "f"; "fl"; "fr"; "p"; "pr"; "pl"; "c"; "cr"; "cl"; "s"; "sc"; "scl"; "scr"; "ph"; "sph"; "phr"; "phl"; "ch"; "chr"; "chl"; "z"; "th"; "thr"; "r"; "x"; |]
            5  +let vowels = [| "a"; "e"; "i"; "o"; "u"; "y"; |]
            6  +let codas = [| "n"; "m"; "r"; "s"; "f"; |]
            7  +let pick a = a.(Random.int(Array.length a))
            8  +let range min max = min+(Random.int(max-min))
            9  +
           10  +let syl () = match range 0 3 with
           11  +	| 0 -> (pick onsets) ^ (pick vowels) ^ (pick codas)
           12  +	| 1 | 2 -> (pick onsets) ^ (pick vowels)
           13  +	| _ -> (pick vowels) ^ (pick codas)
           14  +let rec cat op fn times =
           15  +	if times = 0 then "" else (op (fn()) (cat op fn (times-1)))
           16  +
           17  +let drug () =
           18  +	let prefct = range 0 3 in
           19  +	let sylct = if prefct= 0 then range 1 3 else range 0 3 in
           20  +	(cat (^) (fun () -> pick prefixes) prefct) ^
           21  +	(cat (^) syl sylct) ^
           22  +	(pick suffixes) ^ 
           23  +	(if range 0 7 = 0 then " "^(pick salts) else "")
           24  +let () = Random.self_init (); print_string (drug ()); print_string "\n";

Added procbot.ml version [47c58b9925].

            1  +require "cinch"
            2  +

Added procbot.rb version [d6b2e06ea9].

            1  +#!/usr/bin/ruby
            2  +# encoding: UTF-8
            3  +require "cinch"
            4  +Bots = ["cclg", "sext", "sect", "order", "monster", "pharma", "argue","crime","drug","badbio","bottist","egret_txt", "babdio", "botsoc","dx"]
            5  +ShoutingMatch = /\b(MS\.|MS\s|SERGEANT\s|SGT\s|SGT\.)?\s*(SAMANTHA TAGGART|SAMANTHA TAGUE|SAMANTHA|SAM TAGUE|SAM TAGGART|SAMTAGUE|SAMMY|SAM|TAGUE|TAGGART)\b/
            6  +SmallMatch = /\b(ms\.|ms\s|sergeant\s|sgt\s|sgt\.)?\s*(samantha taggart|samantha tague|samantha|sam tague|sam taggart|samtague|sam|sammy|tague|taggart|(ね|)サム|(ね|)サムさん|(ね|)サムちゃん|سام|يا سام)\b/i
            7  +FormalQs = [
            8  +	"How may I be of assistance",
            9  +	"Yes",
           10  +	"You rang",
           11  +	"What can I do for you today",
           12  +	"Yes",
           13  +	"You rang",
           14  +]
           15  +def mult(a,b)
           16  +	b.map{|bi| a.map{|ai| ai+bi}}.flatten
           17  +end
           18  +$lastcmd = ""
           19  +bot = Cinch::Bot.new do
           20  +	configure do |c|
           21  +		c.server = "irc.oftc.net"
           22  +		c.port = 6697
           23  +		c.channels = ["#crimehole"]
           24  +		c.nick = "samtague"
           25  +		c.user = "samtague"
           26  +		c.realname = "samantha taggart"
           27  +		#c.sasl.username = "sam-tague"
           28  +		#c.sasl.password = "bott-ist-tot"
           29  +		c.ssl.use = true
           30  +	end
           31  +
           32  +	on :message, /\b(ms\.|ms\s|sergeant\s|sgt\s|sgt\.)?\s*(samantha taggart|samantha tague|samantha|sam tague|sam taggart|samtague|sam|tague|taggart|(ね|)サム|(ね|)サムさん|(ね|)サムちゃん|سام|يا سام)\b/i do |m|
           33  +		
           34  +		@m=m
           35  +		@shouting = false
           36  +		def reply(x)
           37  +			if @shouting
           38  +				@m.reply x.upcase
           39  +			else
           40  +				@m.reply x
           41  +			end
           42  +		end
           43  +		formality = :friendly
           44  +		msg = m.params[1]
           45  +		if par = ShoutingMatch.match(msg)
           46  +			@shouting = true
           47  +			cmd=msg.split(ShoutingMatch,2)
           48  +		elsif par = SmallMatch.match(msg)
           49  +			@shouting = false
           50  +			cmd=msg.split(SmallMatch,2)
           51  +		end
           52  +		ranks = {
           53  +			"velartrill" => ["Admiral", "Admiral Hale"].sample,
           54  +			"mtp" => "General",
           55  +			"^alex" => "General",
           56  +			"caurinus" => "Captain",
           57  +			"Riking" => "Lieutenant"
           58  +		}
           59  +		lowranks = [ "Corporal", "Private", "Trooper" ]
           60  +		user = m.user.nick
           61  +		if ranks.include?(user)
           62  +			rank=ranks[user]
           63  +		else
           64  +			rank="Commander"
           65  +		end
           66  +		cmd.map! {|x| x.strip}
           67  +		
           68  +		cmd[1].downcase!
           69  +		if cmd[1] == "ms" or cmd[1] == "ms."
           70  +			formality = :formal
           71  +			name = cmd[2].downcase
           72  +			action = cmd[3].downcase
           73  +		elsif cmd[1] == "sergeant" or cmd[1]=="sgt" or cmd[1]=="sgt."
           74  +			formality = :military
           75  +			name = cmd[2].downcase
           76  +			action = cmd[3]
           77  +		else
           78  +			formality = :friendly
           79  +			name = cmd[1].downcase
           80  +			action = cmd[2]
           81  +		end
           82  +		if action == ""
           83  +			action = cmd[0].downcase
           84  +			action.sub!(/\W*$/,'')
           85  +			greeting = ""
           86  +		else
           87  +			greeting = cmd[0].downcase
           88  +		end
           89  +
           90  +		greetings = ["hey", "hi", "yo", "hello","hey there","hi there","yo there","heya","what up","oh shit","aw yeah","ahlan","hujambo","اهلن", "你好","morning","evening","afternoon","good morning","good evening","good afternoon", "buenos días", "buenos dias", "buenos tardes", "bonjour", "ciao", "bonsoir", "howdy"]
           91  +		if greetings.include?(action.sub(/^\W*/,'').sub(/\W*$/,''))
           92  +			greeting = action
           93  +			action = ""
           94  +		end
           95  +		action.sub!(/^\W*/,'')
           96  +		action.sub!(/^please/,'')
           97  +		action.sub!(/please$/,'')
           98  +		greeting.sub!(/^\W*/,'')
           99  +		greeting.sub!(/\W*$/,'')
          100  +		lowrank = false
          101  +		if formality == :military
          102  +			if action != ""
          103  +				if action.sub!(/^sir\b/i,'') or action.sub!(/\bsir$/i,'') 
          104  +					rank = lowranks.sample
          105  +					lowrank = true
          106  +					action.strip!
          107  +				end
          108  +			end
          109  +		end
          110  +		nulls = {
          111  +			:friendly => [
          112  +				"that's my name, don't wear it out",
          113  +				"yes?",
          114  +				"what's up?",
          115  +				greetings.sample,
          116  +				greetings.sample+", "+user,
          117  +				"what's going on?"
          118  +			],
          119  +			:formal => FormalQs.map {|x| x+"?"} + FormalQs.map {|x| x+", "+user+"?"},
          120  +			:military => lowrank ? [
          121  +				"Report, soldier!",
          122  +				"Stand down, " + rank + "!",
          123  +				"Hold your horses, " + rank + "!",
          124  +				rank + " " + user + "! Report!",
          125  +				"Report!"
          126  +			] : [
          127  +				"Sir!",
          128  +				"What's the situation, sir?",
          129  +				"What's the situation, "+rank+"?",
          130  +			]
          131  +		}
          132  +		affirmatives = {
          133  +			:friendly => [
          134  +				"sure thing.",
          135  +				"no problem.",
          136  +				"no worries.",
          137  +				"will do.",
          138  +				"np!",
          139  +				"sure!",
          140  +				"okay!"
          141  +			],
          142  +			:formal => [
          143  +				"Of course.",
          144  +				"Right away.",
          145  +				"At once.",
          146  +				"As you wish.",
          147  +				"Certainly.",
          148  +				"Pleased to assist.",
          149  +				"At your command."
          150  +			],
          151  +			:military => [
          152  +				"Sir yes sir!",
          153  +				"Ten-four!",
          154  +				"Wilco!",
          155  +				"Roger that!",
          156  +				"Roger that, sir!",
          157  +				"Roger!",
          158  +				"Wilco, sir!",
          159  +				"Wilco, "+rank+"!",
          160  +				"Roger, " +rank+"!",
          161  +			]
          162  +		}
          163  +		def scancmd(x,strs)
          164  +			strs.each { |str|
          165  +				return "" if x==str
          166  +				if x.start_with?(str)
          167  +					return x[str.length+1,x.length]
          168  +				end
          169  +			}
          170  +			return false
          171  +		end
          172  +		def perform(x,user)
          173  +			y=x.split(" ",2)
          174  +			if Bots.include?(y[0].downcase)
          175  +				$lastcmd = x
          176  +				msg = ""
          177  +				bot = "./"+y[0].downcase
          178  +				IO.popen(y.length == 2 ? [bot, y[1]] : bot) { |pd|
          179  +					msg = pd.read
          180  +				}
          181  +				return msg
          182  +			elsif scancmd(x,["what do you think","what are you thinking about","penny for your thoughts","what's your opinion","opinions"])
          183  +				$lastcmd="botsoc"
          184  +				return perform("botsoc",user)
          185  +			elsif scancmd(x,["again", "make another", "do another", "tell another", "make us another", "encore", "more", "do that again", "once more" "one more time", "do it again", "play it again"])
          186  +				if $lastcmd != "" then
          187  +					return perform($lastcmd,user)
          188  +				else
          189  +					return nil
          190  +				end
          191  +			elsif bot=scancmd(x,
          192  +				(mult((mult ["give","tell","make","invent","find","i want","we want","i'd like","we'd like","can i have","can we have","can i get","can we get","create","let's get","let's have","let's hear","lemme have","let me have"], [""," me", " us"]) +
          193  +					["make up", "come up with","do","how about","maybe"], [""," a", " an", " a new", " another", " more", " some", " some more"])+
          194  +					["more","another","a","a new","an","some"]).reverse)
          195  +					# this is the worst thing i have ever done
          196  +					# i am so sorry
          197  +				case bot
          198  +					when "crime", "crimes", "felony", "felonies"
          199  +						return perform("crime",user)
          200  +					when "word", "term", "weird word", "long word", "jargon", "obscure word",
          201  +						"words", "terms", "weird words", "long words", "obscure words"
          202  +						return perform("cclg",user)
          203  +					when "monster", "beast", "monsters", "beasts"
          204  +						return perform("monster",user)
          205  +					when "drug", "drugs","street drug","street drugs"
          206  +						return perform("drug",user)
          207  +					when "pill", "pills", "pharmaceutical", "pharmaceuticals", "legal drug", "legal drugs"
          208  +						return perform("pharma",user)
          209  +					when "bad bio", "bad bios", "bad twitter bio", "bad twitter bios"
          210  +						return perform("badbio",user)
          211  +					when "order", "orders", "my orders", "our orders", "our marching orders","plan of action","our plan of action","our strategy","strategy"
          212  +						return perform("order",user)
          213  +					when "sect", "cult", "sects", "cults"
          214  +						return perform("sect",user)
          215  +					when "sext"
          216  +						return perform("sext",user)
          217  +					when "argument", "arguments", "fight", "fights"
          218  +						return perform("argue",user)
          219  +					when "ideology", "anarchism", "politics", "belief", "creed", "joke"
          220  +						return perform("bottist",user)
          221  +					when "verse", "ominous statement", "line", "prophecy"
          222  +						return perform("egret_txt",user)
          223  +					when "analysis", "opinion", "opine"
          224  +						return perform("botsoc",user)
          225  +					when "diagnosis", "dx"
          226  +						return perform("dx",user)
          227  +				end
          228  +			elsif bot=scancmd(x,["fight with","fight"])
          229  +				$lastcmd = x
          230  +				return perform("argue",user)
          231  +			else
          232  +				return nil
          233  +			end
          234  +		end
          235  +		negatives = {
          236  +			:friendly => [
          237  +				"no can do",
          238  +				"sorry, not happening",
          239  +				"i don't know how",
          240  +				"what?",
          241  +				"huh?",
          242  +				"i'm confused",
          243  +				"????",
          244  +				"what are you asking me to do",
          245  +				"um, no?",
          246  +				"um, no??",
          247  +				"that's fucked up",
          248  +				"isn't that a little problematic",
          249  +				"what do you mean",
          250  +				"that doesn't make any sense",
          251  +				"i don't understand",
          252  +				"what are you talking about",
          253  +				"how?",
          254  +				"what's going on",
          255  +				"what's going on?",
          256  +				"im scared",
          257  +				"i'm scared",
          258  +				"calm down " + user,
          259  +				"what are you talking about, " + user,
          260  +				"i never understand what "+user+" is on about",
          261  +				"im dying",
          262  +				"help",
          263  +				"lol",
          264  +				"lmao",
          265  +				"what",
          266  +				"okay but why",
          267  +				"okay but how",
          268  +				"who do i need to kill",
          269  +				";)",
          270  +				"don't make me come over there",
          271  +				"oh really",
          272  +				"i won't",
          273  +				"no",
          274  +				"you can't make me",
          275  +				"try and make me",
          276  +				"not happening",
          277  +				"not gonna happen",
          278  +				"did you really think that would work",
          279  +				"did you really think that would work, " + user,
          280  +				"did you really think you'd get away with that",
          281  +				"did you really think you'd get away with that, " + user
          282  +			],
          283  +			:formal => [
          284  +				"I'm afraid I can't do that.",
          285  +				"I'm afraid that won't be possible.",
          286  +				"That won't be possible.",
          287  +				"No can do, I'm afraid.",
          288  +				"I don't think I can help you with that.",
          289  +				"I'm sorry to report that is beyond my capabilities at present.",
          290  +				"I don't think I can do that, I'm sorry to say.",
          291  +				"Goodness! I would never dream of such a thing.",
          292  +				"Certainly not! I have a reputation to think of.",
          293  +				"Could you rephrase that?",
          294  +				"I'm sorry, I don't think I understand"
          295  +			],
          296  +			:military => lowrank ? [
          297  +				"Not happening, "+rank+"!",
          298  +				"Don't even think about it, "+rank+"!",
          299  +				"Do I look like I was born yesterday, "+rank+"!",
          300  +				"Not happening, "+rank+" "+user+"!",
          301  +				"Don't even think about it, "+rank+" "+user+"!",
          302  +				"Do I look like I was born yesterday, "+rank+" "+user+"!",
          303  +				"Drop and give me twenty!",
          304  +				"That's it, you're on KP duty!",
          305  +				"No backtalk, maggots!"
          306  +			] : [
          307  +				"Negative, sir.",
          308  +				"Cannot comply, sir.",
          309  +				"Not possible, "+rank+".",
          310  +				"Negative, sir, we're pinned down!",
          311  +				"We don't have the troops for that, "+rank+"!",
          312  +				"Sorry, sir, there's nothing I can do."
          313  +			]
          314  +		}
          315  +		whoareyou = {
          316  +			:friendly => [
          317  +				"i'm sam!",
          318  +				"i'm sam tague!",
          319  +				"samantha taggart",
          320  +				"ash's sister",
          321  +				"ash's little sister",
          322  +				"ash's younger sister"
          323  +			], :formal => [
          324  +				"I am Samantha Taggart.",
          325  +				"My name is Samantha Taggart.",
          326  +				"Taggart. Samantha Taggart.",
          327  +				"The name is Samantha Taggart.",
          328  +				"The name is Taggart.",
          329  +				"Samantha Taggart, esquire."
          330  +			], :military => [
          331  +				"Sergeant Samantha Taggart reporting for duty, sir!",
          332  +				"Sergeant First Class Sam Taggart, sir!",
          333  +				"Sergeant Taggart, sir.",
          334  +				"Sergeant Taggart, sir. The boys call me Tague.",
          335  +				"Sergeant Taggart, sir. But you can call me Sam.",
          336  +				"Sergeant Taggart, sir. Call me Sam."
          337  +			]
          338  +		}
          339  +		goodgirl = {
          340  +			:friendly => [
          341  +				"^_^", ":)",
          342  +				"thanks!",
          343  +				"you're sweet",
          344  +				"just doing my job!",
          345  +				"that's really nice of you",
          346  +				"aw, do you mean it?",
          347  +				"aw, really?",
          348  +				"thank you!",
          349  +			], :formal => [
          350  +				"Of course. I aim to please.",
          351  +				"Happy to be of service.",
          352  +				"Just doing my job.",
          353  +				"It's my pleasure.",
          354  +				"I'm just glad I can be of service.",
          355  +				"You're too kind.",
          356  +				"You're far too kind.",
          357  +				"That's very kind of you.",
          358  +				"Why, thank you!",
          359  +				"It's good to feel appreciated.",
          360  +				"It's always good to feel appreciated.",
          361  +			], :military => [
          362  +				"Yes, sir!",
          363  +				"Sir, yes, sir!",
          364  +				"Roger that, sir!",
          365  +				"Thank you, sir!",
          366  +				"You're not so bad yourself, sir.",
          367  +				"Thank you, sir. And may I just say - it's been a pleasure serving under you, sir.",
          368  +				"Godspeed, sir!"
          369  +			]
          370  +		}
          371  +		dontcare = {
          372  +			:friendly => [
          373  +				"well you should care",
          374  +				"why not",
          375  +				"why don't you care",
          376  +				"you should care",
          377  +				"this matters, " + user,
          378  +				"then you don't understand",
          379  +				"caring is cool",
          380  +				"caring is cool tho"
          381  +			], :formal => [
          382  +				"May I submit that you should, in fact, care?",
          383  +				"I do not believe you appreciate the import of this matter.",
          384  +				"This is more important than you realize.",
          385  +				"I hope you will reconsider.",
          386  +				"Apathy helps no one.",
          387  +				"Apathy solves nothing.",
          388  +				"Your apathy is shameful."
          389  +			], :military => lowrank ? [
          390  +				"Didn't your momma ever tell you caring is cool, soldier?",
          391  +				"Don't give me that, "+lowranks.sample+"!",
          392  +				"Drop and give me twenty, you apathetic worm!",
          393  +				"You don't care? I don't care that you don't care! Drop and give me twenty!",
          394  +				"No backtalk!"
          395  +			] : [
          396  +				"With all due respect, sir, caring is cool, sir!",
          397  +				rank+", sir, I urgently request that you consider your position, sir!",
          398  +				"Sir, with all due respect, I believe you are mistaken as to the importance of the situation, sir.",
          399  +				"Sir, this situation is rapidly spiraling out of control.",
          400  +				"But "+rank+", this situation is rapidly spiraling out of control."
          401  +			]
          402  +		}
          403  +		thankyou = {
          404  +			:friendly => (mult ["np","no worries","sure thing","sure","ofc","of course","glad to help","don't worry about it","just glad to help","no problem","you got it"], ["", "!", "."]),
          405  +			:formal => [
          406  +				"You're welcome.",
          407  +				"You're very welcome.",
          408  +				"It was no trouble.",
          409  +				"It was no trouble at all.",
          410  +				"It was a pleasure.",
          411  +				"It was a pleasure, truly.",
          412  +				"It was my honor.",
          413  +				"I'm pleased to be of service.",
          414  +				"Pleased to be of service.",
          415  +				"Of course.",
          416  +				"Don't mention it.",
          417  +				"Oh, don't mention it."
          418  +			], :military => [
          419  +				"No thanks necessary, sir!",
          420  +				"Just doing my job, sir.",
          421  +				"It's what they pay me for, sir.",
          422  +				"Sir, yes, sir!"
          423  +			]
          424  +		}
          425  +		insults = {
          426  +				:friendly => [
          427  +					"i don't like you either, pal",
          428  +					"fuck you", "fuck you too",
          429  +					"get fucked", "fuck off", "suck this",
          430  +					"lick my clit", "lick my tits", "suck my clit",
          431  +					"suck my tits", "i'm gonna fuck you up",
          432  +					"big talk coming from you, "+user,
          433  +					"you're on my list now, "+user,
          434  +					"go fuck yourself",
          435  +					"i'll remember this",
          436  +					"do you kiss your momma with that mouth?",
          437  +					"die in a fire","get bent","go to hell",
          438  +					"wow rude", "chill out", "take a chill pill",
          439  +					"you need to calm down", "lmao",
          440  +					"get bent", "does it look like i give a fuck what you think about me",
          441  +					"you're problematic", "hey everyone "+user+" sucks donkey balls",
          442  +					"hey everyone "+user+" jacks off to schwarzenegger movies",
          443  +					"hey everyone "+user+" killed JFK",
          444  +					"hey everyone "+user+"'s actually just hundreds of lizards dressed up like a person",
          445  +					"hey everyone "+user+" uses diphenhydramine recreationally",
          446  +					"meanie", "why are you like this", "take that back",
          447  +					"you take that back", "you take that back right now",
          448  +					"you hurt my feelings", "don't hurt my feelings like that",
          449  +					"i thought we were friends!!", "you're a horrible person, "+user,
          450  +					"please stop being mean to me", "why are you so cruel"
          451  +				], :formal => [
          452  +					"How rude!", "Goodness!", "Goodness, how rude!", "Goodness gracious!",
          453  +					"You would do well to treat your betters with more respect than that.",
          454  +					"You've made an enemy today, "+user+".", "I won't tolerate such language!",
          455  +					"I won't tolerate such disrespect!",
          456  +					"I'm sorry, I was unaware my duties would include babysitting today!",
          457  +					"Please show yourself out.", "Your services will no longer be required.",
          458  +					"This is hardly the place for such infantile behavior.",
          459  +					"Why must you be like this?", "Unacceptable!",
          460  +					"Goodness gracious, why must you be like this?"
          461  +				], :military => [
          462  +					"What the hell did you just say to me, maggot?",
          463  +					"Insubordination!",
          464  +					"I'll have you flogged for this!",
          465  +					"You got an awful big mouth on you, "+lowranks.sample+". Let's see you wash the floor with it!",
          466  +					"Insubordination will not be tolerated!",
          467  +					"You'll hang for this!",
          468  +					"Out of line!",
          469  +					"You're out of line!",
          470  +					"You're out of line, soldier!",
          471  +					"Out of line, "+lowranks.sample+" "+user+"!",
          472  +					"You're out of line, "+lowranks.sample+" "+user+"!"
          473  +				]
          474  +			}
          475  +			if param=scancmd(action,["meet","this is","these are",
          476  +						"let me introduce you to","let me introduce",
          477  +						"allow me to introduce you to",
          478  +						"allow me to introduce",
          479  +						"say hi to","say hello to",
          480  +						"introduce yourself to"])
          481  +				param.sub!(/\W*$/,'')
          482  +				reply [
          483  +					"pleased","nice","good",
          484  +					"i'm so happy",
          485  +					"i'm so glad",
          486  +					"it's so nice",
          487  +					"it's so good"
          488  +				].sample+" to "+[
          489  +					"meet you",
          490  +					"get to meet you",
          491  +					"make your acquaintance"
          492  +				].sample+", "+param+(rand(2)==0 ? ". "+user+" has told me so much about you" : "")
          493  +			elsif param=scancmd(action,["good night","night","gnight","g'night","i'm going to bed","going to bed","im going to bed", "bedtime", "time for bed", "it's my bedtime","its my bedtime","nighty-night"])
          494  +				reply mult(["good night","night","sleep well","sleep tight","i wish you an enjoyable cycle of nocturnal hallucinations", "commencement of dormancy phase acknowledged"], ["", ", "+user, ", pesky flesh-creature", ", human", ", mortal"]).sample
          495  +			elsif param=scancmd(action,["i don't care","it doesn't matter","don't care","idc","nevermind","never mind","nvm","i don't give a shit","i don't give a fuck", "does it look like i care"])
          496  +				reply dontcare[formality].sample
          497  +			elsif param=scancmd(action,["fuck you","fuck off","go fuck yourself","get fucked","fu","get bent","diaf","die in a fire","screw you","you cunt","you bitch","you piece of shit","you scumbag","you sleazeball","you jackass","you asshole","you cockroach"])
          498  +				reply insults[formality].sample
          499  +			elsif param=scancmd(action,["thanks","thank you","i appreciate it", "ty", "thx", "obliged", "much obliged","appreciated","danke","gracias","merci","merci beaucoup","shukran","shukran jazeelan","asante","asante sana","arigatou","doumo arigatou", "ありがとう", "どうもありがとう", "どうもありがとうございます","شكران", "شكران جزيلاا"])
          500  +				reply thankyou[formality].sample
          501  +			elsif param=scancmd(action,["well done","good work","excellent work","good girl","nicely done","nice job","good job","perfect","you did well","excellent job","you did great","you did perfect","you did perfectly","wonderful","you did good","gj"])
          502  +				reply goodgirl[formality].sample
          503  +			elsif param=scancmd(action,["who are you","who do you think you are","who even are you","tell me who you are","tell us who you are","introduce yourself"])
          504  +				reply whoareyou[formality].sample
          505  +		elsif greeting==""
          506  +			if action==""
          507  +				reply nulls[formality].sample
          508  +			else
          509  +				result=perform(action,user)
          510  +				r=""
          511  +				if result != nil
          512  +					result.chomp!
          513  +					if formality != :friendly
          514  +						r=affirmatives[formality].sample+" "
          515  +						result[0] = result[0].upcase
          516  +						result += "." if not result=~/\W$/
          517  +					end
          518  +					reply r+result.chomp
          519  +				else
          520  +					reply negatives[formality].sample
          521  +				end
          522  +			end
          523  +		else
          524  +			if action==""
          525  +				if formality == :friendly
          526  +					reply (nulls[:friendly] + [
          527  +						greeting+" yourself"
          528  +					]).sample
          529  +				elsif formality == :formal
          530  +						r = greeting
          531  +						r[0]=r[0].upcase
          532  +						reply r +", " + user + "."
          533  +				elsif formality == :military
          534  +					if lowrank
          535  +						reply [
          536  +							"You're out of line, "+rank+"!",
          537  +							"Cut the chatter, soldier!",
          538  +							"Stow the chit-chat, "+rank+"!",
          539  +						].sample
          540  +					else
          541  +						reply rank+", sir!"
          542  +					end
          543  +				end
          544  +			else
          545  +				if formality == :military and lowrank
          546  +					reply negatives[formality].sample
          547  +					return
          548  +				end
          549  +				result=perform(action, user)
          550  +				r=""
          551  +				if result != nil
          552  +					result[0] = result[0].upcase if formality != :friendly
          553  +					r=affirmatives[formality].sample
          554  +					result.chomp!
          555  +					result += "." if not result=~/\W$/
          556  +					reply r+" "+result
          557  +				else
          558  +					reply negatives[formality].sample
          559  +				end
          560  +			end
          561  +		end
          562  +	end
          563  +	on :message, /daddy/i do |m|
          564  +		m.reply "NO DDLG"
          565  +	end
          566  +	on :message, /monad/i do |m|
          567  +		m.reply "NO HASKELL"
          568  +	end
          569  +	on :message, /satan/i do |m|
          570  +		lucy = ["hail satan", "ave satanas", "all glory to the prince of darkness"]
          571  +		lucy += lucy.map { |x| x.upcase }
          572  +		m.reply(mult(lucy, ["",".","!","!!","!!1"]).sample)
          573  +	end
          574  +	
          575  +	on :message, /there/i do |m|
          576  +		m.reply ["*they're","*their"].sample if rand(50)==0
          577  +	end
          578  +	on :message, /ableis[mt]/i do |m|
          579  +		m.reply ["stop saying that", "that word is banned",
          580  +		"that's not a word anymore, sorry", "you don't get to say that anymore", "nope"].sample 
          581  +		m.reply 'if you mean "harmful to disabled people," say that'
          582  +	end
          583  +	on :message, /your/i do |m|
          584  +		m.reply ["*you're","*yore"].sample if rand(50)==0
          585  +	end
          586  +	on :online, "velartrill" do |m|
          587  +		m.reply "ALL RISE"
          588  +	end
          589  +end
          590  +
          591  +bot.start

Added ritebot.ml version [516880dfa0].

            1  +(* please add your name/handle to the credits section here:
            2  +	- velartrill
            3  +    - riking27
            4  +   also see grammar at line 79 for further editing opportunities
            5  +*)
            6  +let adjs = [| "gleeful"; "putrescent"; "whimsical"; "looming"; "endless"; "infinite"; "final"; "lustful"; 
            7  +	"twilight"; "black"; "lunar"; "solar"; "whispering"; "sundered"; "lawless"; "threefold"; "sevenfold";
            8  +	"tenfold"; "manifest"; "heavenly"; "somber"; "shadowed"; "wandering"; "distant"; "vengeful";
            9  +	"fearful"; "mighty"; "shrieking"; "lofty"; "loathesome"; "faceless"; "silent"; "pale"; "crimson";
           10  +	"fiery"; "wondrous"; "spiteful"; "weary"; "hateful"; "forsaken"; "forbidden"; "mellifluous";
           11  +    "abyssal"; "innocent"; "bronzed"; "fine"; "poor"; "masterful"; "forgotten"; "lost"; "infernal";
           12  +    "merciful"; "merciless"; "reckless"; "wonderful"; "beloved"; "ancient"; "decrepit"; "abstract";
           13  +    "honorable"; "animated"; "bloody"; "dead"; "old"; "expired"; "new"; "fresh"; |]
           14  +let nouns = [| "orb"; "law"; "moon"; "night"; "fist"; "question"; "deceit"; "perception"; "regret";
           15  +	"wonder"; "terror"; "hope"; "lust"; "inception"; "manifestation"; "whole"; "sea"; "stone"; "earth";
           16  +	"door"; "gate"; "portal"; "tree"; "fear"; "might"; "egret"; "circle"; "pit"; "crevice"; "hand"; "face";
           17  +	"inferno"; "spite"; "loom"; "malice"; "vial"; |]
           18  +let forces = [| "prince"; "king"; "queen"; "archon"; "god"; "demon"; "lord"; "lady"; "thing"; "wind";
           19  +	"beast"; "terror"; "spirit"; "spirits"; "muse"; "sylph"; "fool"; "child"; "creature"; "drake"; |]
           20  +let kinds = [| "rite"; "ritual"; "spell"; "invocation"; "evocation"; "conjuration"; "abjuration"; "binding"; 
           21  +	"incantation"; "appeasement"; "craft"; "alchemy"; "transmutation"; "transmogrification"; "incitement";
           22  +    "debasement"; "blessing"; "consecrecation"; "desecration"; |]
           23  +
           24  +(* two of these are combined to form a surname *)
           25  +let people_name_elts = [| "wind"; "horn"; "fear"; "sea"; "sun"; "sky"; "star"; "hand"; "cold"; "warm"; "sand";
           26  +	"soul"; "sin"; "pale"; "dark"; "dread"; "hammer"; "lust"; "rage"; "blood"; "fire"; "flame"; "over"; "blight";
           27  +    "thunder"; "time"; "space"; "void"; "light"; "mind"; "life"; "air"; "breath"; "heir"; "doom"; "stein"; "chill";
           28  +    "cool"; "love"; "just"; "drake"; "hell"; "war"; "wright"; "bone"; |] 
           29  +
           30  +(* these precede surnames *)
           31  +let forenames = [| "abigail"; "mordred"; "morgan"; "samantha"; "rachael"; "cassandra"; "jedediah"; "zebediah";
           32  +    "malachi"; "malachiah"; "charles"; "jezebel"; "simon"; "simone"; "salamandrael"; "jehosaphat"; "josiah";
           33  +    "mandrake"; "jessifer"; "sophia"; "morgause"; "winfred"; "winnifred"; "jennifer"; "carlissa"; "carlotta";
           34  +    "carissa"; "melissa"; "xylinda"; "samedra"; "damara"; "kurloz"; "hans"; "vladimir"; |] 
           35  +    
           36  +(* titles prefix a name, i.e. Sir Abigail Lusthammer *)
           37  +let titles = [| "sir"; "king"; "lord"; "queen"; "empress"; "dame"; "madam"; "mistress"; "master"; "lady";
           38  +    "emperor"; "archmage"; "magister"; "archmagister"; "magistress"; "magistrix"; "archmagistress";
           39  +    "archmagistrix"; "knight"; "agent"; |] 
           40  +	
           41  +type node = R of string array | B of node array | OL of node list | O of node | L of node list | S of string
           42  +
           43  +let pick a = a.(Random.int(Array.length a))
           44  +let range min max = min+(Random.int(max-min))
           45  +let rec eval n : string = match n with
           46  +	| R(n) -> pick n
           47  +	| OL(n) -> eval (O(L n))
           48  +	| B(n) -> eval (pick n) 
           49  +	| O(n) -> if range 0 2 = 0 then eval n else ""
           50  +	| L(n) -> List.fold_left (fun a b -> a ^ (eval b)) "" n
           51  +	| S(s) -> s
           52  +
           53  +let people = L [ R people_name_elts; R people_name_elts; ]
           54  +let force = L [R adjs; S " "; R forces]
           55  +let attrib = L[OL[R titles; S" "]; OL[R forenames; S" "]; people; OL[S" the "; R adjs;];S"'s ";]
           56  +let ritual_name = B [|
           57  +	L [O attrib; OL[R adjs; S " "]; R kinds; S " of "; O(S "the "); OL[force; S "'s "]; OL[R adjs; S " "]; R nouns; ];
           58  +	L [attrib; OL[R adjs; S " "]; R nouns; ]
           59  +|]
           60  +
           61  +let agents = [| "a child"; "a bird"; "an eagle"; "a thief"; "a king"; "a conqueror"; "a fool"; "a madman";
           62  +			"an innocent"; "a murderer"; "a virgin"; "a queen"; "a pauper"; "a fox"; "a girl"; "a boy";
           63  +            "a dying man"; "a drake"; "a beast"; "a spirit"; "a sylph"; "a seer"; "the wind"; |]
           64  +let liquids = B [| S "blood"; S "ale"; S "wine"; S "water"; S"sea-water"; S"river-water"; S"lake-water"; L[S "the blood of "; R agents]; |]
           65  +let liquid_containers = [| "chalice"; "ewer"; "goblet"; "bowl"; "waterskin"; "bottle"; "cask"; |]
           66  +let object_containers = [| "bowl"; "box"; "basket"; "chest"; |]
           67  +let surfaces = [| "plinth"; "platter"; "altar"; "plate"; |]
           68  +let objects = [| "stone"; "feather"; "orb"; "quill"; "knife"; "candle"; "bow"; "bullet";
           69  +	"necklace"; "charm"; "amulet"; "biscuit"; |]
           70  +let materials = [| "crystal"; "bone"; "iron"; "steel"; "copper"; "gold"; "silver"; "sapphire"; "opal";
           71  +	"jade"; "amethyst"; "quartz"; "diamond"; "emerald"; "tin"; "zinc"; "bismuth"; "sterling"; "bronze"; "blood"; |]
           72  +(* [optional[partorigin], bodyparts] *)
           73  +let bodyparts = [| "skull"; "femur"; "blood"; "tooth"; "toe"; "eye"; "eyeball"; "skin"; "hand"; "fingernail";
           74  +	"claw"; "toenail"; "tail"; "vertebra"; "backbone"; "heart"; "liver"; "spleen"; "womb"; "fetus"; "fin"; |]
           75  +let partorigin = [| "human"; "virgin"; "cow"; "dog"; "horse"; "beast"; "wolf"; "alligator"; "goat"; "bird";
           76  +	"crow"; "eagle"; "dove"; "pigeon"; "owl"; "elephant"; "bear"; "fox"; "buzzard";
           77  +    (* posessives *)
           78  +    "a beloved pet's"; "an innocent's"; "the target's"; "your"; "your"; "an intruder's"; |]
           79  +
           80  +type thingkind = Liquid_container | Object_container | Surface | Object
           81  +type thing = {
           82  +	kind : thingkind;
           83  +	name : string;
           84  +	adj : string option;
           85  +	desc : string option;
           86  +}
           87  +let times = R[| "once"; "twice"; "thrice"; |]
           88  +let places = [| "in a dreadful ravine"; "in a forsaken village"; "at the bottom of the sea"; "on the moon";
           89  +			"in a grave"; "in a mausoleum"; "beneath a tree"; "where it should not have been"; "in the sea";
           90  +            "in a dwelling"; "in a forest"; |]
           91  +let desc =
           92  +	(* kinds *) B[|
           93  +		(* actions *) L[ B[|
           94  +			L[S"found";
           95  +				OL[S" "; R places];
           96  +				OL[S" by ";
           97  +					R(Array.concat [agents; [|"one who should not have found it"; |]])];
           98  +			];
           99  +			
          100  +			L[S"lost";
          101  +				OL[S" "; 
          102  +					R(Array.concat [places;[|"to the sea";|]])];
          103  +				OL[S" by "; 
          104  +					R(Array.concat [agents; [|"one who should not have lost it"; |]])];
          105  +			];
          106  +			L[S "stolen";
          107  +				OL[S" by "; 
          108  +					R(Array.concat [agents; [|"one who should not have stolen it"; |]])];
          109  +				OL[S" from "; 
          110  +					R(Array.concat [agents; [|"one who should not have lost it";"one who should not have stolen it";
          111  +					"one who should never have held it"; "its rightful owner"; "a vault"; "a castle"; "a beast"; |]])];
          112  +			];
          113  +			L[S "washed";
          114  +				OL[S" "; R[|
          115  +					"in the sea"; "in blood"; "beneath a waterfall"; "in a fountain"; "in a lake long-dry";
          116  +					"in tears"; "in tears of grief"; "in tears of joy";|]];
          117  +				OL[S" by "; 
          118  +					R(Array.concat [agents; [|"an elderly washerwoman"; |]])];
          119  +			];
          120  +		|];
          121  +		(* circumstances *) O(B[|
          122  +			S" at night";
          123  +			S" by chance";
          124  +			S" long ago";
          125  +			S" years ago";
          126  +			S" in the distant past";
          127  +			S" at noon";
          128  +			S" at dawn";
          129  +			S" in war";
          130  +            S" at war";
          131  +            S" for years";
          132  +            S" by accident";
          133  +		|]);
          134  +	];
          135  +    (* traits *) B[|
          136  +		L[times; S"-blessed"];
          137  +		L[times; S"-cursed"];
          138  +		S "black as night";
          139  +		S "red as blood";
          140  +        S "white as bone";
          141  +        S "blue as the sky";
          142  +        S "green as grass";
          143  +        S "bright as gold";
          144  +        S "old as time";
          145  +	|];
          146  +|]
          147  +
          148  +let adj_material = L[ O(OL[R adjs; S" "]); OL[R materials; S" "]; ]
          149  +			
          150  +let newthing () : thing = let kind = pick [|Liquid_container; Object_container; Surface; Object;|] in {
          151  +	kind = kind;
          152  +	adj = pick[|None; Some(pick adjs)|];
          153  +	desc = pick[|None; Some(eval desc)|];
          154  +	name = match kind with
          155  +		| Liquid_container -> eval (L[adj_material; R liquid_containers])
          156  +		| Object_container -> eval (L[adj_material; R object_containers])
          157  +		| Surface -> eval (L[adj_material; R surfaces])
          158  +		| Object -> eval (B[|
          159  +			L[adj_material; R objects];
          160  +			L[OL[R partorigin; S" "]; R bodyparts;]
          161  +		|])}
          162  +let descthing t = (match t.adj with Some(s) -> s^" " | None -> "")^
          163  +	(*(String.uppercase_ascii()*) t.name^
          164  +	(match t.desc with Some(s) -> ", "^s | None -> "")
          165  +
          166  +
          167  +let ritual () =
          168  +	let name = eval ritual_name in
          169  +	let foci =
          170  +		let rec acc (times : int) : thing list = (newthing ()) :: (if times = 0 then [] else acc (times-1))
          171  +		in acc (range 0 10)
          172  +	in
          173  +	(String.uppercase_ascii(name))^"\n\n"^
          174  +	(pick [|"You will need:"; "Components:"; "Foci:"; "Ingredients:"; "Elements:"; "Materials:";
          175  +		"You must gather:"; "Necessary offerings:"|]) ^"\n"^
          176  +		(let rec enumerate_foci n f = match f with
          177  +			| x :: rs -> ((string_of_int n) ^ ") " ^ (descthing x) ^ "\n") ^ (enumerate_foci (n+1) rs)
          178  +			| [] -> "" in enumerate_foci 1 foci)
          179  +	
          180  +let () = Random.self_init (); print_string (ritual ());;
          181  +

Added sectbot.ml version [870ab943c4].

            1  +type word = R of string | I of string * string
            2  +type apos = Obs | Size | Attrib | Shape | Age | Mid | Color | Origin | Material | Qual
            3  +let order adj = match (let _,a = adj in a) with
            4  +	| Obs -> 0 | Size -> 1 | Attrib -> 2 | Shape -> 3 | Age -> 4
            5  +	| Mid -> 5 | Color -> 6 | Origin -> 7 | Material -> 8 | Qual -> 9
            6  +type adj = string * apos
            7  +let adjs : adj array = [|
            8  +	"Sanctified", Obs; "Blasphemous", Obs; "Red", Color; "Yellow", Color;
            9  +	"Ebon", Color; "Ochre", Color; "Eternal", Age; "Perpetual", Age;
           10  +	"Everlasting", Age; "Black", Color; "White", Color; "Mad", Obs;
           11  +	"Infinite", Attrib; "Timeless", Age;  "Terrible", Obs; "Sightless", Obs;
           12  +	"All-Seeing", Mid; "Third", Obs;  "Second", Obs;  "Endless", Obs;
           13  +	"Reviled", Obs; "Absolute", Obs; "Damned", Obs; "Cursed", Obs;
           14  +	"Blessed", Obs; "Lucid", Obs; "Unthinkable", Obs; "Nameless", Obs;
           15  +	"Unspeakable", Obs; "Glorious", Obs; "Cold", Obs; "Burning", Obs;
           16  +	"Shapeless", Shape;  "Formless", Shape; "Unknowable", Obs; "Lifeless", Obs;
           17  +	"Fatal", Attrib; "Infernal", Origin; "Abyssal", Origin; "Celestial", Origin;
           18  +	"Implacable", Obs; "Dark", Color; "Resolute", Obs; "Resplendant", Color;
           19  +	"Unstoppable", Obs; "Blood-Soaked", Material; "Endless", Size;
           20  +	"Forgotten", Obs; "Iron", Material; "Bronze", Material; "Steel", Material;
           21  +	"Secret", Obs; "Hidden", Obs; "Fiery", Color; "Ancient", Age;
           22  +	"Silver", Material; "Silver", Color; "Screaming", Mid; "Mighty", Mid;
           23  +	"Thousand-Year", Qual; "Jewelled", Material; "Damnable", Mid; 
           24  +	"Creeping", Mid; "All-Knowing", Mid; "All-Hearing", Mid; "Holy", Mid;
           25  +	"Global", Mid; "Leering", Mid; "Forty-Second", Obs; "Divine", Mid;
           26  +	"Faithful", Mid; "Ageless", Age; "Steadfast", Attrib; "Cruel", Attrib;
           27  +	"Sapphire", Material; "Sapphic", Origin; "Secluded", Mid; "Scarlet", Color;
           28  +	"Shrieking", Mid; "Hollow", Mid; "Mild", Mid; "Wondrous", Obs;
           29  +|]
           30  +let subjects = [|
           31  +	"Order"; "Cult"; "Temple"; "Church"; "Hand"; "Eyes";
           32  +	"Source"; "Keepers"; "Maidens"; "Servants"; "Templars";
           33  +	"Followers"; "Celebrants"; "Rite"; "Sect"; "Guild";
           34  +	"Society"; "School"; "Gathering"; "Bearers"; "Guardians";
           35  +	
           36  +|]
           37  +let definite_objects = [|
           38  +	"Prince"; "King"; "Master"; "Princess"; "Queen"; "Mistress";
           39  +	"Devourer"; "Obliterator"; "Destroyer"; "Portal";
           40  +	"Serpent"; "Moon"; "One"; "Two"; "Three"; "Four";
           41  +	"Five"; "Six"; "Seven"; "Eight"; "Nine"; "Ten"; "Twelve";
           42  +	"Eye"; "God"; "Horror"; "Thing"; "Flames"; "Night"; "Day";
           43  +	"Year"; "Years"; "Way"; "Realm"; "Path"; "Light"; "Fire";
           44  +	"Door"; "Gate"; "Plan"; "Terror"; "Staff"; "Window";
           45  +	"Road"; "Spire"; "Beast"; "Flesh"; "Sword"; "Mountain";
           46  +	"River";"Crown";"Scepter"; "Desecrator";"Defiler";
           47  +	"Despoiler"; "Ravager"; "Rite"; "Sea"; "Ocean"; "Chaos";
           48  +	"Goat"; "Legion"; "Pyramid"; "Dragon"; "Hand"; "Pantheon";
           49  +	"Spirit"; "Devil"; "Gods"; "Rod"; "Glitch"; "Error";
           50  +	"Perversion";
           51  +|]
           52  +let zero_objects = [|
           53  +	"Doom"; "Death"; "Torment"; "Fires"; "Pain"; "Screams";
           54  +	"Fear"; "Terror"; "Whispers"; "Failure"; "Perversion";
           55  +|]
           56  +
           57  +let pick (r : 'a array) : 'a = r.(Random.int(Array.length r))
           58  +let picks (r : ('b * ('a array)) list) : ('b * 'a) =
           59  +	let sum = List.fold_left (fun c (_,a) -> c + Array.length a) 0 r in
           60  +	let id = Random.int sum in
           61  +	let rec find i (l : (bool * ('a array)) list) =
           62  +		match l with (tag,a)::tl ->
           63  +		let sz = Array.length a in
           64  +			if sz > i then (tag, a.(i))
           65  +			else find (i-sz) tl
           66  +		| _ -> assert false
           67  +	in find id r;;
           68  +	
           69  +let adjp () =
           70  +	let flatten l = List.fold_left (fun a (s,_) -> a ^ " " ^ s) "" l in
           71  +	let rec pos adj (phr : adj list) =
           72  +		if (phr = []) then [adj]
           73  +		else if (order adj) > order (List.hd phr) then
           74  +			(List.hd phr) :: (pos adj (List.tl phr))
           75  +		else adj :: (List.tl phr)
           76  +	in let rec loop phr ct =
           77  +		if ct = 0 then pos (pick adjs) phr
           78  +		else loop (pos (pick adjs) phr) (ct-1)
           79  +	in flatten (loop [] (Random.int 4));;
           80  +	
           81  +let objp () = picks [(true, definite_objects); (false, zero_objects)]
           82  +let sect () = let a = adjp() in
           83  +	let a' = adjp() in
           84  +	let def,o = objp() in
           85  +	match Random.int 7 with		(* haaack *)
           86  +		| 0 -> "The " ^ (pick subjects) ^ " of the " ^ (let a,_ = pick adjs in a)
           87  +		| 1 -> "The " ^ (pick subjects) ^ " of " ^ (if def then "the " else "") ^ o
           88  +		| 2 -> "The" ^ a' ^ " " ^ (pick subjects) ^ " of " ^ (if def then "the " else "") ^ o
           89  +		| 3 -> "The" ^ a' ^ " " ^ (pick subjects) ^ " of the " ^ (let a,_ = pick adjs in a)
           90  +		| _ ->  "The" ^ a' ^ " " ^ (pick subjects) ^ " of" ^ (if def then " the" else "") ^ a ^ " " ^ o
           91  +		
           92  +let () = Random.self_init ();
           93  +	print_string (sect())

Added sextbot.ml version [96e435dd0f].

            1  +type noun = R of string * string | V of string * string | M of string | Mv of string | Pn of string | Pnv of string
            2  +let sn n = R(n, n^"s")
            3  +let nouns = [|
            4  +	R("pussy", "pussies"); sn "cock"; R("penis", "penises"); sn "representative";
            5  +	R("minority","minorities"); sn "dick"; sn "breast"; sn "mouth"; sn "face";
            6  +	M "hair"; Pn "politics"; sn "soul"; sn "ear"; sn "nose"; sn "senator"; sn "kink";
            7  +	sn "girl"; sn "boy"; R("city","cities"); R("titty","titties"); sn "vagina"; sn "bot";
            8  +	sn "butt"; R("foot","feet"); R("moose","moose"); sn "daughter"; sn "cunt";
            9  +	sn "Bolshevik"; sn "goat"; sn "tentacle"; sn "uncle"; sn "queen"; sn "peer"; 
           10  +	R("party","parties"); R("cooch","cooches"); R("snooch","snooches"); sn "tit";
           11  +	V("ass","asses"); sn "gender"; sn "cop"; M "police"; sn "loser"; sn "king";
           12  +	sn "rifle"; sn "vibrator"; Pn "authorities"; R("box","boxes"); sn "orifice"; 
           13  +	sn "count"; sn "baron"; R("countess","countesses"); R("baroness","baronesses");
           14  +	R("thesis","theses"); M "praxis"; M "rope"; Pn "handcuffs"; sn "boob"; 
           15  +	sn "critique"; sn "slave"; sn "buttslut"; sn "idea"; sn "revolver"; sn "corpse";
           16  +	R("ideology","ideologies"); sn "beast"; sn "youth"; sn "tail"; sn "bulge";
           17  +	sn "tty"; sn "dongle"; sn "shell"; sn "result"; sn "argument"; sn "guitar"; 
           18  +	R("class","classes"); V("advance","advance"); sn "restraint"; sn "nipple"; 
           19  +	sn "orb"; M "junk"; sn "array"; R("matrix","matrices"); sn "crack"; sn "fork"; 
           20  +	R("mistress","mistresses"); V("assignment","assignments");
           21  +	R("switch","switches"); sn "sin"; sn "creep"; sn "Pope";  sn "weeb";
           22  +	sn "submission"; sn "strap"; sn "noun"; sn "verb"; R("cross","crosses"); sn "whip"; 
           23  +	M "faith"; Pn "beliefs"; Pn "panties";	 V("implement","implements"); 
           24  +	sn "text"; sn "book"; sn "grimoire"; sn "twink"; sn "blog"; sn "scandal"; 
           25  +	Pn "drugs"; Mv "evil"; M "good"; sn "moron"; sn "fuck"; sn "neck"; sn "cad"; 
           26  +	sn "fucker"; sn "stalker"; R("beauty","beauties"); sn "jock"; sn "people";
           27  +	sn "bro"; sn "president"; sn "nerd"; sn "rival"; sn "hacker"; sn "johnson"; 
           28  +	V("illusion","illusions"); sn "hand"; R("ash","ashes"); M "love"; sn "father";
           29  +	sn "mother"; R("boundary","boundaries"); sn "callout"; sn "appendage"; 
           30  +	sn "callout post"; sn "death"; R("witch","witches"); sn "limb"; sn "loophole";
           31  +	V("attack surface","attack surfaces"); sn "claw"; M "democracy"; sn "cannon"; 
           32  +	R("woman","women"); M "shit"; Mv "artillery"; R("facility","facilities"); 
           33  +	R("man","men"); sn "blog post"; R("knife","knives"); sn "moon"; M "truth";
           34  +	R("fetish","fetishes"); R("tummy","tummies"); sn "bunker"; sn "pigeon";
           35  +	V("orgasm", "orgasms"); sn "startup"; sn "throat"; sn "wizard"; sn "robe";
           36  +	sn "spell"; sn "fanfic"; sn "rack"; sn "thumbscrew"; sn "ballot"; sn "campaign";
           37  +	sn "gay"; sn "lesbian"; sn "mommyblog"; sn "widget"; sn "spine"; sn "hell";
           38  +	sn "candidate"; sn "dog"; sn "pig"; R("Tory","Tories"); sn "prime minister";
           39  +	V("outrage","outrages"); V("elf","elves"); R("dwarf","dwarves"); V("orc","orcs");
           40  +	V("ork","orks"); M "discourse"; V("imbecile","imbeciles"); sn "monolith";
           41  +	sn "scepter"; V("obelisk","obelisks"); sn "clit"; R("clitoris","clitorises"); M "porn";
           42  +	sn "wound"; sn "relationship"; sn "probe"; sn "porn"; sn "secret"; R("lady","ladies");
           43  +	V("anxiety","anxieties"); M "scum"; M "dirt"; M "trash"; R("witch","witches");
           44  +	M "steam"; M "smoke"; R("senpai","senpai"); R("kohai","kohai"); M "vore";
           45  +	R("sensei","sensei"); sn "meat"; R("staff","staves"); sn "rod"; M "terror";
           46  +	V("anus","anuses"); R("church","churches"); sn "debate"; sn "console";
           47  +	M "bondage"; M "discipline"; sn "catboy"; sn "catgirl"; sn "top"; sn "bottom";
           48  +	sn "submissive"; sn "dom"; sn "domme"; sn "prole"; sn "car"; sn "hat";
           49  +	sn "commander"; sn "general"; sn "sergeant"; sn "lieutenant"; sn "ensign";
           50  +	sn "captain"; sn "admiral"; sn "doctor"; Pn "steel beams"; R("furry","furries");
           51  +	V("insecurity","insecurities"); sn "limit"; sn "law"; sn "enchantment";
           52  +	R("postmaster general","postmasters general"); R("wench","wenches");
           53  +	sn "shame cube"; sn "government"; sn "laser"; M "blood"; M "sex";
           54  +	sn "mace"; sn "flail"; sn "neg"; sn "dome"; V("atom","atoms"); sn "chest";
           55  +	M "space"; sn "flaw"; sn "failure"; R("booty","booties"); sn "beaver";
           56  +	sn "governor"; sn "nuke"; sn "nuclear missile"; sn "nuclear warhead";
           57  +	V("ICBM","ICBMs"); V("electrode","electrodes"); Mv "abuse";
           58  +	sn "machine"; sn "fucker"; R("boris","borises"); R("gary","garies");
           59  +	sn "doom"; sn "pimp"; sn "shitpost"; Pnv "evils"; Pn "Crime Hole";
           60  +	
           61  +	R ("[REDACTED]","[REDACTED]");
           62  +	V ("[REDACTED]","[REDACTED]");
           63  +|]
           64  +type word = A of string | An of string
           65  +let adjs = [|
           66  +	A "gleaming"; A "bleeding"; A "stupid"; A "useless"; A "sexy";
           67  +	A "tight"; A "wet"; A "hard"; A "kinky"; A "pervy"; A "Republican";
           68  +	A "naughty"; A "filthy"; A "slutty"; A "revolutionary"; A"nuclear";
           69  +	A "counterrevolutionary"; A "hopeless"; A "satanic"; A "sex";
           70  +	A "nuclear sex"; A "lusty"; A "noble"; A "witty"; A "hot"; A "soft";
           71  +	A "steamy"; A "Marxist"; A "horny"; A "slutty"; A "lustful";
           72  +	A "lawful"; A "bold"; A "sophisticated"; A "winsome"; A "dumb";
           73  +	A "bulging"; A "throbbing"; A "scrawny"; A "problematic";
           74  +	A "duly appointed"; A "wondrous"; A "scandalous"; A "papal";
           75  +	A "holy"; A "whimpering"; A "Bluetooth-enabled"; A "fuckable";
           76  +	A "sentient"; A "Turing-complete"; A "redneck"; A "corrective";
           77  +	A "lawless"; A "lunar"; A "solar"; A "luminous"; A "repressive";
           78  +	A "sustainable"; A "wise"; A "wizardly"; A "sorcerous"; A "wizard";
           79  +	A "magic"; A "presidential"; A "campaign"; A "gay"; A "lesbian";
           80  +	A "regressive"; A "psychic"; A "sad"; A "happy"; A "humble";
           81  +	A "Tory"; A "sinister"; A "sick"; A "twisted"; A "moderate";
           82  +	A "horrific"; A "horrifying"; A "conservative"; A "sensible";
           83  +	A "meaningless"; A "luscious"; A "lucrative"; A "terror";
           84  +	A "secret"; A "snobby"; A "bratty"; A "mystical"; A "$300";
           85  +	A "$700"; A "$1000"; A "100-carat"; A "cool"; A "rad";
           86  +	A "radical"; A "terrorist"; A "firm"; A "dead"; A "decaying";
           87  +	A "submissive"; A "dominant"; A "moist"; A "humiliating"; 
           88  +	A "government sex"; A "government"; A "sext"; A "ballistic";
           89  +	A "government sext"; A "glistening"; A "blood"; A "strategic";
           90  +	A "laser"; A "government blood"; A "+1"; A "cursed"; A "space";
           91  +	A "space sex"; A "monumental"; A "restrained"; A "helpless";
           92  +	A "boring"; A "heterosexual"; A "monogamous"; A "hairy";
           93  +	A "sin"; A "sinful"; A "tactical"; A "rectal"; A "fucking";
           94  +	A "dread"; A "dread sex"; A "dread government"; A "pimp";
           95  +	A "dread government sex"; A "doom"; A "government doom";
           96  +	
           97  +	An "awful"; An "electronic"; An "electric"; An "ugly";
           98  +	An "illegal"; An "unlawful"; An "arcane"; An "undulating";
           99  +	An "appropriate"; An "inappropriate"; An "appropriative";
          100  +	An "eminent"; An "ominous"; An "oppressive"; An "anal";
          101  +	An "unsustainable"; An "outrageous"; An "insensitive";
          102  +	An "elfin"; An "elvish"; An "elfin sex"; An "elvish sex";
          103  +	An "esoteric"; An "exotic"; An "abusive"; An "austere";
          104  +	An "embarrassing"; An "erotic"; An "imperial";
          105  +	An "immaculate"; An "evil"; An "evil government";
          106  +	An "evil sex"; An "evil elf"; An "evil gay";
          107  +|]
          108  +let pick (r : 'a array) : 'a = r.(Random.int(Array.length r))
          109  +let coin () = if Random.int 2 = 0 then true else false
          110  +let getform p noun = match noun with 
          111  +		| Mv (n) | M(n) -> n
          112  +		| Pn (n) | Pnv(n) -> n
          113  +		| V(sg,pl) -> (if p then pl else sg)
          114  +		| R(sg,pl) -> (if p then pl else sg);;
          115  +		
          116  +let stat noun = let plural = match noun with 
          117  +		| Mv (_) | M(_) -> false
          118  +		| Pn (_) | Pnv(_) -> true
          119  +		| _ -> coin() in
          120  +	let form, vl = match noun with
          121  +		| V(sg,pl) -> if plural then pl,true else sg,true
          122  +		| R(sg,pl) -> if plural then pl,false else sg,false
          123  +		| Mv(n) -> n,true
          124  +		| M(n) -> n,false 
          125  +		| Pn(n) -> n,true 
          126  +		| Pnv(n) -> n,true in plural, form, vl;;
          127  +
          128  +let bnp force_sg : string * bool = let noun = pick nouns in
          129  +	let p, form, vl = stat noun in
          130  +	let plural = if force_sg then false else p in
          131  +	let dets = Array.append [| "my"; "your"; "the"; "some"; |]
          132  +		(if plural then [| "these"; "those"; |] else [| "this"; "that"; |]) in
          133  +	let adj = if coin () then None else Some (pick adjs) in
          134  +	(if Random.int 5 = 0 then
          135  +		if plural then form else match adj with
          136  +		| None -> if vl then "an "^form else "a "^form
          137  +		| Some(A(n)) -> "a "^n^" "^form
          138  +		| Some(An(n)) -> "an "^n^" "^form
          139  +	else (pick dets) ^(
          140  +		match adj with
          141  +			| None -> ""
          142  +			| Some(A(n)) | Some(An(n)) -> " "^n
          143  +	)^" "^form),plural;;
          144  +	
          145  +
          146  +type form = Bare | Sg | Ppl | Ing
          147  +type verb = (form -> string option -> string)
          148  +let actions' : verb array ref = ref [||]
          149  +let np () = let base, number = bnp false in 
          150  +	let n = match Random.int 30 with
          151  +		| 0 -> base ^ " of " ^ (let b,_ = bnp false in b)
          152  +		| 1 -> base ^ " of " ^ ((pick !actions') Ing (if coin() then None else Some (
          153  +			getform true (pick nouns)
          154  +		)))
          155  +		| 2 -> base ^ " of " ^ (match pick adjs with A(n) | An(n) -> n) ^
          156  +			" " ^ ((pick !actions') Ing None)
          157  +		| 3 -> (let b,_ = bnp true in b) ^ "'s " ^ (getform (coin()) (pick nouns))
          158  +		| _ -> base
          159  +	in (n,number);;
          160  +	
          161  +let strn () = let n,_ = np() in n
          162  +
          163  +let svb (sg,pl,ing,ppl) : verb = (fun f obj -> let o = match obj with
          164  +		| None -> ""
          165  +		| Some x -> " "^x
          166  +	in (match f with
          167  +		| Bare -> sg
          168  +		| Sg -> pl
          169  +		| Ppl -> ppl
          170  +		| Ing -> ing)^o)
          171  +let phrvb (sg,pl,ing,ppl) prep = (fun f obj -> let o = match obj with
          172  +		| None -> ""
          173  +		| Some x -> " "^x
          174  +	in (match f with
          175  +		| Bare -> sg
          176  +		| Sg -> pl
          177  +		| Ppl -> ppl
          178  +		| Ing -> ing)^o^" "^prep)
          179  +let ppvb (sg,pl,ing,ppl) prep = (fun f obj -> let o = match obj with
          180  +		| None -> ""
          181  +		| Some x -> " "^x
          182  +	in (match f with
          183  +		| Bare -> sg
          184  +		| Sg -> pl
          185  +		| Ppl -> ppl
          186  +		| Ing -> ing)^o^" "^prep^" "^(strn()))
          187  +let svt x = (x,x^"s",x^"ing",x^"ed")
          188  +let svte x = (x^"e",x^"es",x^"ing",x^"ed")
          189  +let evt x = (x,x^"es",x^"ing",x^"ed")
          190  +
          191  +let simple_verbs : verb array = [|
          192  +	svb (svt "yank");
          193  +	svb (svte "delet");
          194  +	svb (svt "compress");
          195  +	svb (svt "fuck");
          196  +	svb (svt "sext");
          197  +	svb (svt "spank");
          198  +	svb (svt "smack");
          199  +	svb (svt "fork");
          200  +	svb ("slap", "slaps", "slapping", "slapped");
          201  +	svb (evt "publish");
          202  +	svb (evt "punish");
          203  +	svb (evt "kiss");
          204  +	svb (svt "stay");
          205  +	svb (svt "laser");
          206  +	svb (svt "censor");
          207  +	svb (svt "tweet");
          208  +	svb ("vore","vores","voring","vored");
          209  +	svb ("bite","bites","biting","bitten");
          210  +	svb (evt "dox");
          211  +	svb ("police", "polices", "policing", "policed");
          212  +	svb (svt "inspect");
          213  +	svb ("defile", "defiles", "defiling", "defiled");
          214  +	svb ("@", "@s", "@'ing", "@'ed");
          215  +	svb ("shoot","shoots","shooting","shot");
          216  +	svb ("ship","ships","shipping","shipped");
          217  +	svb ("stun","stuns","stunning","stunned");
          218  +	svb (svte "mutilat");
          219  +	svb (svte "criticiz");
          220  +	svb ("debunk","debunks","debunking","debunked");
          221  +	svb (svte "critiqu");
          222  +	svb ("smite", "smites", "smiting", "smitten");
          223  +	svb ("verify", "verifies", "verifying", "verified");
          224  +	svb (svt "restrain");
          225  +	svb ("inflect", "inflects", "inflecting", "inflected");
          226  +	svb ("whip", "whips", "whipping", "whipped");
          227  +	svb (svte "squeez");
          228  +	svb (svt "pull");
          229  +	svb (svt "flatten");
          230  +	svb (svt "crush");
          231  +	svb (svte "abus");
          232  +	svb ("cut", "cuts", "cutting", "cut");
          233  +	svb ("dispel", "dispels", "dispelling", "dispelled");
          234  +	svb ("split", "splits", "splitting", "split");
          235  +	svb (svte "throttl");
          236  +	svb (svte "strangl");
          237  +	svb (svt "slaughter");
          238  +	svb (svte "grop");
          239  +	svb (svte "vap");
          240  +	svb (svt "sever");
          241  +	svb (svt "stalk");
          242  +	svb (svt "mock");
          243  +	svb ("stab", "stabs", "stabbing", "stabbed");
          244  +	svb (svt "snort");
          245  +	svb ("ban", "bans", "banning", "banned");
          246  +	svb ("oppress", "oppresses", "oppressing", "oppressed");
          247  +	svb ("suppress", "suppresses", "suppressing", "suppressed");
          248  +	svb ("depress", "depresses", "depressing", "depressed");
          249  +	svb (svt "sadden");
          250  +	svb (svte "curs");
          251  +	svb (svte "vot");
          252  +	svb (svt "disrupt");
          253  +	svb (svte "humbl");
          254  +	svb (svt "fucc");
          255  +	svb (svt "69");
          256  +	svb (svt "cuck");
          257  +	svb ("snap", "snaps", "snapping", "snapped");
          258  +	svb (svte "pleasur");
          259  +	svb (svte "pleas");
          260  +	svb (svt "cuff");
          261  +	svb (svt "melt");
          262  +	svb (svte "deprecat");
          263  +	svb (svte "debat");
          264  +	svb (svt "dick");
          265  +	svb ("bleed", "bleeds", "bleeding", "bled");
          266  +	svb (svt "finger");
          267  +	svb (svt "exploit");
          268  +	svb ("portscan", "portscans", "portscanning", "portscanned");
          269  +	svb ("bully", "bullies", "bullying", "bullied");
          270  +	svb (svt "enchant");
          271  +	svb ("steal", "steals", "stealing", "stolen");
          272  +	svb (svt "yiff");
          273  +	phrvb (svt "yiff") "up";
          274  +	svb (svt "duel");
          275  +	svb (svt "repeal");
          276  +	svb (svt "twist");
          277  +	svb (svt "abolish");
          278  +	svb (svte "punctur");
          279  +	svb (svte "roboticiz");
          280  +	svb ("wiretap", "wiretaps", "wiretapping", "wiretapped");
          281  +	svb ("do", "does", "doing", "done");
          282  +	svb (svt "dial");
          283  +	svb (svte "enslav");
          284  +	svb ("neg", "negs", "negging", "negged");
          285  +	svb (svt "slander");
          286  +	svb (svt "smear");
          287  +	svb (svt "sex");
          288  +	svb (svte "censur");
          289  +	svb (svte "exoticiz");
          290  +	svb (svte "romanticiz");
          291  +	svb (svt "bombard");
          292  +	svb (svte "seduc");
          293  +	svb (svt "despoil");
          294  +	svb (svt "destroy");
          295  +	svb (svte "ravag");
          296  +	svb (svt "ravish");
          297  +	svb (svt "plunder");
          298  +	svb ("[REDACTED]","[REDACTED]","[REDACTED]","[REDACTED]");
          299  +	svb (svte "delud");
          300  +	svb (svt "redact");
          301  +	svb (svte "denigrat");
          302  +	svb (svte "expung");
          303  +	svb (svt "insert");
          304  +	ppvb (svt "insert") "in";
          305  +	svb (svt "lick");
          306  +	svb (svt "defeat");
          307  +	svb (svt "defend");
          308  +	svb (svte "interrogat");
          309  +	svb (svte "tortur");
          310  +	svb (svt "shock");
          311  +	svb (svte "scandaliz");
          312  +	svb ("beat","beats","beating","beaten");
          313  +	svb (svt "obey");
          314  +	svb (svt "disobey");
          315  +	svb (svt "doom");
          316  +	svb (svt "pimp");
          317  +	svb (svt "dissect");
          318  +	svb (svt "transcend");
          319  +	svb (svte "exorcis");
          320  +	svb (svte "compil");
          321  +	svb (svte "decompil");
          322  +|]
          323  +
          324  +let complex_verbs : verb array = [|
          325  +	svb ("laugh at","laughs at","laughing at","laughed at");
          326  +	svb ("shoot at","shoots at","shooting at","shot at");
          327  +	svb ("shout at","shouts at","shouting at","shouted at");
          328  +	phrvb (svt "fuck") "up";
          329  +	phrvb (evt "mess") "up";
          330  +	phrvb ("hold","holds","holding","held") "down";
          331  +	phrvb (evt "push") "down";
          332  +	phrvb (svt "knock") "down";
          333  +	phrvb ("tie","ties","tying","tied") "down";
          334  +	phrvb ("tie","ties","tying","tied") "up";
          335  +	ppvb ("tie","ties","tying","tied") "up with";
          336  +	ppvb ("tie","ties","tying","tied") "to";
          337  +	phrvb ("take","takes","taking","taken") "offline";
          338  +	phrvb ("take","takes","taking","taken") "apart";
          339  +	ppvb ("take","takes","taking","taken") "out of";
          340  +	phrvb ("take","takes","taking","taken") "out";
          341  +	ppvb ("take","takes","taking","taken") "out for";
          342  +	phrvb ("beat","beats","beating","beaten") "up";
          343  +	phrvb ("beat","beats","beating","beaten") "off";
          344  +	ppvb ("beat","beats","beating","beaten") "up with";
          345  +	ppvb (svte "shov") "onto";
          346  +	ppvb (svte "shov") "off";
          347  +	ppvb (svte "shov") "out of";
          348  +	ppvb (svte "shov") "down";
          349  +	ppvb (svt "smack") "in";
          350  +	ppvb (svt "smack") "right in";
          351  +	ppvb (svt "smack") "with";
          352  +	ppvb ("slap", "slaps", "slapping", "slapped") "with";
          353  +	ppvb ("slap", "slaps", "slapping", "slapped") "in";
          354  +	ppvb ("slap", "slaps", "slapping", "slapped") "right in";
          355  +	phrvb ("slap", "slaps", "slapping", "slapped") "silly";
          356  +	phrvb ("slap", "slaps", "slapping", "slapped") "off";
          357  +	ppvb (evt "punish") "with";
          358  +	ppvb (evt "kiss") "on";
          359  +	phrvb (svt "connect") "to the internet";
          360  +	ppvb (svt "connect") "to";
          361  +	ppvb (svt "disconnect") "from";
          362  +	phrvb (svt "disconnect") "from the internet";
          363  +	ppvb ("put","puts","putting","put") "in";
          364  +	ppvb (svt "lock") "in";
          365  +	phrvb ("shoot","shoots","shooting","shot") "down";
          366  +	ppvb ("shoot","shoots","shooting","shot") "in";
          367  +	phrvb ("set","sets","setting","set") "on fire";
          368  +	phrvb ("set","sets","setting","set") "to 'stun'";
          369  +	phrvb ("get","gets","getting","gotten") "all over";
          370  +	ppvb ("get","gets","getting","gotten") "all over";
          371  +	phrvb ("spill","spills","spilling","spilt") "all over";
          372  +	ppvb ("spill","spills","spilling","spilt") "all over";
          373  +	phrvb ("strap","straps","strapping","strapped") "down";
          374  +	ppvb ("strap","straps","strapping","strapped") "to";
          375  +	phrvb ("keep","keeps","keeping","kept") "out";
          376  +	ppvb ("keep","keeps","keeping","kept") "in";
          377  +	phrvb ("keep","keeps","keeping","kept") "down";
          378  +	ppvb ("keep","keeps","keeping","kept") "out of";
          379  +	svb ("beg for","begs for","begging for","begged for");
          380  +	ppvb (svte "forc") "into";
          381  +	ppvb ("ship","ships","shipping","shipped") "with";
          382  +	svb ("submit", "submits", "submitting", "submitted");
          383  +	svb ("submit to", "submits to", "submitting to", "submitted to");
          384  +	svb ("conjugate", "conjugates", "conjugating", "conjugated");
          385  +	svb ("decline", "declines", "declining", "declined");
          386  +	ppvb ("inflict", "inflicts", "inflicting", "inflicted") "on";
          387  +	ppvb (svt "restrain") "with";
          388  +	ppvb ("whip", "whips", "whipping", "whipped") "with";
          389  +	svb ("bind", "binds", "binding", "bound");
          390  +	ppvb ("bind", "binds", "binding", "bound") "with";
          391  +	ppvb ("bind", "binds", "binding", "bound") "to";
          392  +	svb (svt "respect");
          393  +	svb (svt "disrespect");
          394  +	svb (svte "dictat");
          395  +	ppvb (svte "dictat") "to";
          396  +	svb ("control", "controls", "controlling", "controlled");
          397  +	svb (svt "follow");
          398  +	svb (svt "unfollow");
          399  +	svb (svte "simulat");
          400  +	svb (svte "stimulat");
          401  +	svb (svte "relocat");
          402  +	ppvb (svte "reloca") "to";
          403  +	svb (svte "lik");
          404  +	svb (svte "crav");
          405  +	svb ("deny", "denies", "denying", "denied");
          406  +	ppvb (svte "argu") "with";
          407  +	svb ("argue with", "argues with", "arguing with", "argued with");
          408  +	svb (svte "conjur");
          409  +	phrvb (svte "conjur") "up";
          410  +	svb ("conjure upon", "conjures upon", "conjuring upon", "conjured upon");
          411  +	svb (svt "detect");
          412  +	ppvb (svte "disabus") "of";
          413  +	ppvb ("cut", "cuts", "cutting", "cut") "with";
          414  +	ppvb ("cut", "cuts", "cutting", "cut") "up with";
          415  +	phrvb ("cut", "cuts", "cutting", "cut") "up";
          416  +	phrvb ("cut", "cuts", "cutting", "cut") "off";
          417  +	svb (svte "disassembl");
          418  +	svb (svt "clean");
          419  +	phrvb ("tidy", "tidies", "tidying", "tidied") "up";
          420  +	svb ("tidy", "tidies", "tidying", "tidied");
          421  +	ppvb (svte "disassembl") "with";
          422  +	phrvb (svt "mock") "online";
          423  +	phrvb (svt "mock") "on the internet";
          424  +	phrvb (svt "mock") "on Twitter";
          425  +	phrvb (svt "call") "out";
          426  +	phrvb (svt "call") "names";
          427  +	svb ("sin with", "sins with", "sinning with", "sinned with");
          428  +	phrvb (svt "call") "out";
          429  +	svb ("jerk it to", "jerks it to", "jerking it to", "jerked it to");
          430  +	svb ("get off on", "gets off on", "getting off on", "got off on");
          431  +	phrvb (svt "exploit") "for sex";
          432  +	svb (svte "eviscerat");
          433  +	svb (svt "dismember");
          434  +	svb (svte "dislocat");
          435  +	svb (svte "decriminaliz");
          436  +	svb (svte "legaliz");
          437  +	svb (svte "disparag");
          438  +	svb (svte "evolv");
          439  +	svb ("evolve into", "evolves into", "evolving into", "evolved into");
          440  +	svb ("devolve into", "devolves into", "devolving into", "devolved into");
          441  +	svb (svte "appropriat");
          442  +	svb (svte "downvot");
          443  +	svb (svte "upvot");
          444  +	
          445  +	svb (svte "standardiz");
          446  +	svb ("commune with", "communes with", "communing with", "communed with");
          447  +
          448  +	svb (svt "devour");
          449  +	svb (svte "demoniz");
          450  +	phrvb (svte "vot") "into office";
          451  +	phrvb (svte "vor") "into office";
          452  +	svb ("vote for", "votes for", "voting for", "voted for");
          453  +	svb ("spit on", "spits on", "spitting on", "spat on");
          454  +	svb ("shit on", "shits on", "shitting on", "shat on");
          455  +	svb ("sit on", "sits on", "sitting on", "sat on");
          456  +	svb (svte "demoraliz");
          457  +	svb ("whisper to", "whispers to", "whispering to", "whispered to");
          458  +	svb (svt "discern");
          459  +	svb (svt "disgust");
          460  +	svb (svt "offend");
          461  +	svb (svt "disdain");
          462  +	svb (svt "resent");
          463  +	svb ("lie to", "lies to", "lying to", "lied to");
          464  +
          465  +	ppvb ("rub", "rubs", "rubbing", "rubbed") "with";
          466  +	ppvb ("rub", "rubs", "rubbing", "rubbed") "on";
          467  +	ppvb ("rub", "rubs", "rubbing", "rubbed") "all over";
          468  +	ppvb ("rub", "rubs", "rubbing", "rubbed") "down with";
          469  +	phrvb ("rub", "rubs", "rubbing", "rubbed") "down";
          470  +	ppvb ("grind", "grinds", "grinding", "ground") "on";
          471  +	ppvb (svt "fill") "with";
          472  +	svb (svt "fill");
          473  +	phrvb ("snap", "snaps", "snapping", "snapped") "off";
          474  +	svb ("bleed on", "bleeds on", "bleeding on", "bled on");
          475  +	svb (svt "wound");
          476  +	svb (svt "harm");
          477  +	svb (svte "prob");
          478  +	ppvb (svte "prob") "for";
          479  +	svb (svte "automat");
          480  +	svb ("watch", "watches", "watching", "watched");
          481  +	svb (svt "monitor");
          482  +	svb (svte "observ");
          483  +	svb ("expel", "expels", "expelling", "expelled");
          484  +	ppvb ("expel", "expels", "expelling", "expelled") "from";
          485  +	svb ("throw", "throws", "throwing", "thrown");
          486  +	phrvb ("throw", "throws", "throwing", "thrown") "out";
          487  +	ppvb ("throw", "throws", "throwing", "thrown") "into";
          488  +	svb ("sing about", "sings about", "singing about", "sung about");
          489  +	svb ("sing for", "sings for", "singing for", "sung for");
          490  +	svb ("sing with", "sings with", "singing with", "sung with");
          491  +	svb (svt "deflect");
          492  +	svb (svte "resembl");
          493  +	svb (svte "consol");
          494  +	svb ("write about", "writes about", "writing about", "written about");
          495  +	svb (svt "honor");
          496  +	ppvb (svt "honor") "with";
          497  +	svb (svt "dishonor");
          498  +	ppvb (svt "dishonor") "with";
          499  +	svb ("extol the virtues of", "extols the virtues of", "extolling the virtues of", "extolled in virtue");
          500  +	svb (svte "disciplin");
          501  +	svb (svte "dominat");
          502  +	svb ("top", "tops", "topping", "topped");
          503  +	svb (svte "servic");
          504  +	svb (svte "serv");
          505  +	svb (svt "download");
          506  +	svb (svt "upload");
          507  +	svb (svt "hack");
          508  +	svb (svte "friendzon");
          509  +	svb (svte "vindicat");
          510  +	svb (svte "shame cub");
          511  +	svb (svte "sham");
          512  +	svb ("fux", "fuxes", "fuxing", "fuxed");
          513  +	phrvb (svt "duel") "to the death";
          514  +	ppvb (svt "duel") "for";
          515  +	ppvb (svt "duel") "to death for";
          516  +	ppvb (svt "duel") "to the death for";
          517  +	svb (svte "kinksham");
          518  +	ppvb (svte "punctur") "with";
          519  +	ppvb (svte "penetrat") "with";
          520  +	svb (svt "enter");
          521  +	phrvb (svt "dial") "up";
          522  +	phrvb (svt "tweet") "up";
          523  +	svb ("tweet at","tweets at","tweeting at","tweeted at");
          524  +	svb (svte "placat");
          525  +|]
          526  +
          527  +let trverbs = Array.append simple_verbs complex_verbs;;
          528  +
          529  +actions' := simple_verbs
          530  +
          531  +let trvp (f : form) : string = if Random.int 15 != 0 then ((pick trverbs) f (Some (strn ())))
          532  +	else ((pick simple_verbs) f (Some (strn ()))) ^ " to death"
          533  +let vp (f : form) : string = ((pick trverbs) f None)
          534  +
          535  +let titles = [| 
          536  +	"mistress"; "master"; "lady"; "lord"; "señora"; "mademoiselle"; "señor"; "monsieur"; "bro";
          537  +	"daddy"; "mommy"; "slave"; "girl"; "boy"; "fucktoy"; "senator"; "fuckslave"; "manslave";
          538  +	"slut"; "buttslut"; "uncle"; "buttslave"; "professor"; "princess"; "prince"; "father"; "sir";
          539  +	"friar"; "president"; "dear"; "your holiness"; "your grace"; "your excellency"; "your worship";
          540  +	"your honor"; "milady"; "milord"; "mister"; "missy"; "congressman"; "your eminence";
          541  +	"your imperial majesty"; "your majesty"; "miss"; "babe"; "Mr. Chairman"; "Mr. President";
          542  +	"Madam Secretary"; "Madam President"; "cuntslave"; "prime minister"; "minister"; "sire";
          543  +	"senpai"; "kohai"; "sensei"; "commander"; "general"; "sergeant"; "lieutenant"; "ma'am";
          544  +	"captain"; "admiral"; "doctor"; "ensign"; "madame"; "maîtresse"; "maître"; "cap'n"; "baby";
          545  +	"babe"; "comrade"; "citizen";
          546  +|]
          547  +let bareadj () = match pick adjs with A(a) | An(a) -> a;;
          548  +
          549  +let clause () = let n, pl = np () in
          550  +	n ^ " " ^ (trvp (if pl then Bare else Sg));;
          551  +let (^^) s c = s ^ (String.make 1 c);;
          552  +let capitalize_each s = 
          553  +	let rec loop (i : int) (o : string) (sp : bool) = 
          554  +		if i = (String.length s) then o
          555  +		else match s.[i] with
          556  +			| ' ' -> loop (i+1) (o^^' ') true
          557  +			| 'a'..'z' as c -> if sp
          558  +				then loop (i+1) (o^^(Char.uppercase_ascii c)) false
          559  +				else loop (i+1) (o^^c) false
          560  +			| _ as c -> loop (i+1) (o^^c) false
          561  +	in loop 0 "" true
          562  +let spell () = let name = (pick trverbs) Bare (Some(match pick nouns with
          563  +	| R(sg,pl) | V(sg,pl) -> pick [|sg;pl|]
          564  +	| M(n) | Mv(n) | Pn(n) | Pnv(n) -> n)) in capitalize_each name
          565  +let ivb f = pick [|
          566  +	(fun () -> (pick trverbs) f (Some "you"));
          567  +	(fun () -> (pick trverbs) f (Some "you"));
          568  +	(fun () -> (pick trverbs) f (Some "ye"));
          569  +	(fun () -> (pick trverbs) f (Some "myself"));
          570  +	(fun () -> (pick trverbs) f (Some "myself"));
          571  +	(fun () -> (pick trverbs) f (Some "meself"));
          572  +	(fun () -> (trvp f));
          573  +	(fun () -> (trvp f));
          574  +|]();;
          575  +let uvb f = pick [|
          576  +	(fun () -> (pick trverbs) f (Some "yourself"));
          577  +	(fun () -> (pick trverbs) f (Some "me"));
          578  +	(fun () -> (pick trverbs) f (Some "yourself"));
          579  +	(fun () -> (pick trverbs) f (Some "me"));
          580  +	(fun () -> (pick trverbs) f (Some "yeself"));
          581  +	(fun () -> (trvp f));
          582  +|]();;
          583  +let rec tpls = [|
          584  +	(fun () -> clause());
          585  +	(fun () -> "I like "^(strn()));
          586  +	(fun () -> "I'm "^(strn()));
          587  +	(fun () -> "I'm always "^(strn()));
          588  +	(fun () -> "I'm always a slut for "^(strn()));
          589  +	(fun () -> "I'm always "^(strn())^" for "^(strn()));
          590  +	(fun () -> "I'm always "^(bareadj())^" for "^(strn()));
          591  +	(fun () -> "I, um, I "^(ivb Bare));
          592  +	(fun () -> "I, um, "^(ivb Bare));
          593  +	(fun () -> "you, um, you "^(uvb Bare));
          594  +	(fun () -> "you, um, "^(uvb Bare));
          595  +	(fun () -> "I like to "^(ivb Bare));
          596  +	(fun () -> "I like to, how you say, "^(ivb Bare));
          597  +	(fun () -> "I'm gonna "^((pick simple_verbs) Bare (Some "you"))^" silly and call you \""^(pick titles)^"\"");
          598  +	(fun () -> "you "^((pick simple_verbs) Bare (Some "me"))^" silly and call me \""^(pick titles)^"\"");
          599  +	(fun () -> ((pick simple_verbs) Bare (Some "me"))^" silly and call me \""^(pick titles)^"\"");
          600  +	(fun () -> "you want to be "^((pick simple_verbs) Ppl None)^" silly and called \""^(pick titles)^"\"");
          601  +	(fun () -> "I want to "^(ivb Bare));
          602  +	(fun () -> "let me "^(ivb Bare));
          603  +	(fun () -> "I wanna "^(ivb Bare));
          604  +	(fun () -> "I'm gonna "^(ivb Bare));
          605  +	(fun () -> "I'm going to "^(ivb Bare));
          606  +	(fun () -> "I need to "^(ivb Bare));
          607  +	(fun () -> "I gotta "^(ivb Bare));
          608  +	(fun () -> "you need to "^(uvb Bare));
          609  +	(fun () -> "you need to be "^((pick trverbs) Ppl None));
          610  +	(fun () -> "you gotta "^(uvb Bare));
          611  +	(fun () -> "you must not "^(uvb Bare));
          612  +	(fun () -> "you wouldn't "^(uvb Bare));
          613  +	(fun () -> "don't make me "^(ivb Bare));
          614  +	(fun () -> "I force you to "^(uvb Bare));
          615  +	(fun () -> "you force me to "^(ivb Bare));
          616  +	(fun () -> "I'm "^(bareadj ()));
          617  +	(fun () -> "I'm gonna make you "^(bareadj ()));
          618  +	(fun () -> "you're "^(bareadj ()));
          619  +	(fun () -> "this is "^(bareadj ()));
          620  +	(fun () -> "this is very "^(bareadj ()));
          621  +	(fun () -> "this is deeply "^(bareadj ()));
          622  +	(fun () -> "you have to "^(uvb Bare)^" if you want to be my "^(pick titles));
          623  +	(fun () -> "I "^(ivb Bare));
          624  +	(fun () -> "I cast "^(spell ()));
          625  +	(fun () -> "I need to cast "^(spell ()));
          626  +	(fun () -> "don't make me cast "^(spell ()));
          627  +	(fun () -> "I cast "^(spell ())^" on you");
          628  +	(fun () -> "don't make me cast "^(spell ())^" on you");
          629  +	(fun () -> "I cast "^(spell ())^" on myself");
          630  +	(fun () -> "I need to cast "^(spell ())^" on myself");
          631  +	(fun () -> "you cast "^(spell ()));
          632  +	(fun () -> "you need to cast "^(spell ()));
          633  +	(fun () -> "you cast "^(spell ())^" on me");
          634  +	(fun () -> "you need to cast "^(spell ())^" on me");
          635  +	(fun () -> "you cast "^(spell ())^" on yourself");
          636  +	(fun () -> "you need to cast "^(spell ())^" on yourself");
          637  +	(fun () -> "I'm "^(ivb Ing));
          638  +	(fun () -> "I've "^(ivb Ppl));
          639  +	(fun () -> "you've "^(uvb Ppl));
          640  +	(fun () -> "you "^(uvb Bare));
          641  +	(fun () -> "look me in the eye when I "^(pick trverbs) Bare (Some "you"));
          642  +	(fun () -> "keep your eyes on "^(strn())^" while I "^(ivb Bare));
          643  +	(fun () -> "you must really want to be "^(vp Ppl)^(if coin() then "" else " by "^(strn())));
          644  +	(fun () -> "you must really want me to "^(ivb Bare));
          645  +	(fun () -> "you must really want "^(strn())^" to "^(trvp Bare));
          646  +	(fun () -> "you're gonna get "^(vp Ppl));
          647  +	(fun () -> (if coin() then "please " else "") ^ "put "^(strn())^" in "^(strn())^(if coin() then "" else ", and then "^(trvp Bare)));
          648  +	(fun () -> (trvp Bare));
          649  +	(fun () -> "please " ^ (trvp Bare));
          650  +	(fun () -> ((pick trverbs) Bare (Some "me")) ^ " and " ^ ((pick trverbs) Bare (Some "me")));
          651  +	(fun () -> (pick tpls)() ^" so I can "^(ivb Bare));
          652  +	(fun () -> (pick tpls)() ^" hard");
          653  +	(fun () -> (pick tpls)() ^" harder");
          654  +	(fun () -> (pick tpls)() ^", if that's alright");
          655  +	(fun () -> (pick tpls)() ^", in the Biblical sense");
          656  +	(fun () -> (pick tpls)() ^" - in the Biblical sense");
          657  +	(fun () -> (pick tpls)() ^", if you don't mind");
          658  +	(fun () -> (pick tpls)() ^", if you know what I mean");
          659  +	(fun () -> "um, " ^ (pick tpls)());
          660  +	(fun () -> "arrrr, " ^ (pick tpls)());
          661  +	(fun () -> "yarrr, " ^ (pick tpls)());
          662  +	(fun () -> "well, " ^ (pick tpls)());
          663  +	(fun () -> "you know, " ^ (pick tpls)());
          664  +	(fun () -> "haha, " ^ (pick tpls)());
          665  +|]
          666  +let epithets = [| "lover"; "punk"; "slut"; "slave"; "fuck"; "fucker"; "toy"; "eater"; "snob"; "lord"; "-ass"; "boy"; "girl"; "bro"; "-man"; "man";|]
          667  +let rec mtpls = [| (* haaaaack *)
          668  +	(fun () -> (pick tpls)());
          669  +	(fun () -> (pick tpls)());
          670  +	(fun () -> (pick tpls)());
          671  +	(fun () -> (pick tpls)()^"~");
          672  +	(fun () -> (pick tpls)()^"?");
          673  +	(fun () -> (pick tpls)() ^", right?");
          674  +	(fun () -> (pick tpls)() ^" - no homo");
          675  +	(fun () -> (pick tpls)() ^" - no hetero");
          676  +	(fun () -> (pick tpls)() ^", but no homo");
          677  +	(fun () -> (pick tpls)() ^", yeah?");
          678  +	(fun () -> (pick tpls)() ^", alright?");
          679  +	(fun () -> "wanna "^(uvb Bare)^"?");
          680  +	(fun () -> "wanna "^(uvb Bare)^", if you know what I mean?");
          681  +	(fun () -> (pick tpls)() ^", "^(pick titles));
          682  +	(fun () -> (pick tpls)() ^", "^(pick titles)^"~");
          683  +	(fun () -> "hey "^(pick titles)^", "^(pick tpls)());
          684  +	(fun () -> (pick tpls)() ^", "^(pick titles)^"-san");
          685  +	(fun () -> (pick tpls)() ^", "^(pick titles)^"-kun");
          686  +	(fun () -> (pick tpls)() ^", "^(pick titles)^"-sama");
          687  +	(fun () -> (pick tpls)() ^", "^(pick titles)^"-chan");
          688  +	(fun () -> (pick tpls)() ^", "^(pick titles)^"-tan");
          689  +	(fun () -> (pick tpls)() ^", "^(pick titles)^"-senpai");
          690  +	(fun () -> "please, "^(pick tpls)() ^", "^(pick titles)^"-san");
          691  +	(fun () -> "please, "^(pick titles)^"-san, "^(pick tpls)());
          692  +	(fun () -> (pick tpls)() ^", "^(match pick nouns with R(n,_) | V(n,_) | M(n) | Mv(n) | Pn(n) | Pnv(n) -> n)^"-san"); (* yeesh *)
          693  +	(fun () -> (pick tpls)() ^", you "^(match pick nouns with R(n,_) | V(n,_) | M(n) | Mv(n) | Pn(n) | Pnv(n) -> n)^(if coin() then "" else (pick epithets))); (* yeesh *)
          694  +	(fun () -> (pick tpls)() ^", you "^
          695  +		(match pick adjs with A(a) | An(a) -> a)^" "^
          696  +		(match pick nouns with R(n,_) | V(n,_) | M(n) | Mv(n) | Pn(n) | Pnv(n) -> n)
          697  +		^(if coin() then "" else (pick epithets))); (* yeeeeeeeeeeesh *)
          698  +|]
          699  +let rec ntpls = [|
          700  +	(fun name -> (pick tpls)() ^", "^name);
          701  +	(fun name -> (pick tpls)() ^", "^name);
          702  +	(fun name -> (pick tpls)() ^", "^name);
          703  +	(fun name -> (pick tpls)() ^", "^name);
          704  +	(fun name -> (pick tpls)() ^", "^name);
          705  +	(fun name -> (pick tpls)() ^", "^name^"~");
          706  +	(fun name -> (pick tpls)() ^", "^name^"~");
          707  +	(fun name -> (pick tpls)() ^", "^name^" - no homo");
          708  +	(fun name -> (pick tpls)() ^", "^name^" - no hetero");
          709  +	(fun name -> "Hey "^name^", "^(pick tpls)());
          710  +	(fun name -> "Hey "^name^", "^(pick tpls)());
          711  +	(fun name -> "Hey "^name^", "^(pick tpls)());
          712  +	(fun name -> "Hey "^name^", "^(pick tpls)());
          713  +	(fun name -> "Hey "^name^", "^(pick tpls)()^"~");
          714  +	(fun name -> "Hey "^name^", "^(pick tpls)()^" - no homo");
          715  +	(fun name -> "Hey "^name^", "^(pick tpls)()^" - no hetero");
          716  +	(fun name -> "Hey "^name^", "^(trvp Bare));
          717  +	(fun name -> "Hey "^name^", "^(trvp Bare));
          718  +	(fun name -> "Hey "^name^", "^(trvp Bare));
          719  +	(fun name -> "Hey "^name^", "^(trvp Bare));
          720  +	(fun name -> "Hey "^name^", "^(trvp Bare)^"~");
          721  +	(fun name -> "Hey "^name^", "^(trvp Bare)^" - no homo");
          722  +	(fun name -> "Hey "^name^", "^(trvp Bare)^" - no hetero");
          723  +|]
          724  +let () = Random.self_init ();
          725  +	if (Array.length Sys.argv = 1) || (Sys.argv.(1) = "") then print_string (String.capitalize_ascii ((pick mtpls)()))
          726  +	else print_string (String.capitalize_ascii ((pick ntpls) (String.trim Sys.argv.(1))));
          727  +	print_string "\n";
          728  +	

Added threat.ml version [dc6a67ba01].

            1  +let range min max = min+(Random.int (max-min))
            2  +let pick ar = ar.(range 0 (Array.length ar))
            3  +let rule (items : string list Lazy.t array) = let syntax = Lazy.force(pick items) in
            4  +    List.fold_left (^) "" syntax 
            5  +let choice ar = Lazy.force(pick ar)
            6  +type person = {
            7  +    nom : string;
            8  +    gen : string;
            9  +    acc : string;
           10  +}
           11  +
           12  +let victims = [|
           13  +    {nom="you";gen="your";acc="you"};
           14  +|]
           15  +let insults = [|
           16  +    "bitch"; "cunt"; "freak"; "douchebag";
           17  +    "bastard";
           18  +|]
           19  +let action victim = rule [|
           20  +    lazy ["port "; victim.acc; " to lisp"];
           21  +    lazy ["rain on "; victim.gen; " parade"];
           22  +|]
           23  +let intros () =
           24  +    let vocative () = match range 0 3 in
           25  +        | 0 -> "you"
           26  +        | 1 -> pick insults
           27  +        | 2 -> "you, " ^ (pick insults) in
           28  +    rule [|
           29  +        lazy ["listen up, "; vocative (); "!
           30  +|]
           31  +let threat () = (intros()) ^ " " ^ (action (pick victims)) 
           32  +let () =
           33  +    Random.self_init();
           34  +    print_string (threat ())

Added threat.scm version [c3beb2da63].

            1  +(include "bot.scm")
            2  +
            3  +(define actors
            4  +  '#(me you thou they him her myself "your mother" "your mom" "your father"
            5  +	"your dad" "your aunt" "your uncle" "your dog"))
            6  +
            7  +(define pronouns '(
            8  +  (you    (nom . "you")  (acc . "you")  (gen . "your")  (poss . "yours")  )
            9  +  (thou   (nom . "thou") (acc . "thee") (gen . "thy")   (poss . "thine")  )
           10  +  (they   (nom . "they") (acc . "them") (gen . "their") (poss . "theirs") )
           11  +  (him    (nom . "he")   (acc . "him")  (gen . "his")   (poss . "his")    )
           12  +  (her    (nom . "her")  (acc . "her")  (gen . "hers")  (poss . "hers")   )
           13  +  (me	  (nom . "I")    (acc . "me")   (gen . "my")    (poss . "mine")   )
           14  +  (myself (nom . "I") 	 (acc . "myself") (gen . "my own") (poss . "my own"))))
           15  +
           16  +(define (conjugate v t n)
           17  +  (if (eq? v 'cop)
           18  +	(case (cons t n)
           19  +	
           20  +
           21  +(define (inflect c n)
           22  +  (if (string? n)
           23  +	(case c
           24  +	  ((nom acc)  n)
           25  +	  ((gen poss cop) (string-append n "'s")))
           26  +	; else
           27  +	(cdr (assq c (cdr (assq n pronouns))))))
           28  +
           29  +(rule (action victim)
           30  +  ("port " victim " to lisp")
           31  +  ("rain on " victim "'s parade"))
           32  +
           33  +(rule (subject actor)
           34  +  ((inflect 'cop actor) " gonna")
           35  +  ((inflect 'nom actor) " swear"))
           36  +  
           37  +(print
           38  +  (inflect
           39  +	(pick '#(nom acc gen poss))
           40  +	(pick actors)))
           41  +
           42  +;(print (action "you"))