Volume - I Can't Belive It's Not Tracery
[The old method: it created substantial performance issues when heavily used across large lists.
To say pop (N - a list of texts):
sort N in random order;
now pop-count is 1;
say entry 1 in N.]
a-coming is a truth state that varies. a-coming is false.
To say *a: now a-coming is true.
To say pop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
now pop-count is Q;
let Z be entry Q of N;
[if bannery is true begin;
now Z is bancheck N;
end if;]
now Z is the substituted form of Z;
if a-coming is true begin;
let F be character number 1 in Z;
if F matches the regular expression "<AEIOUaeiou>" begin;
say "n ";
otherwise;
say " ";
end if;
now a-coming is false;
end if;
say Z;
[The following is phased out for now; it was intended to analyse strings for banned combinations of words, but it messed up a lot of stuff and made for performance issues.]
To decide what text is bancheck (N - a list of texts):
let FINE be 0;
let Z be "";
while FINE is 0 begin;
let X be the number of entries in N;
let Q be a random number between 1 and X;
now Z is entry Q of N;
let BANS be bantrack;
add Z to BANS;
let BADSHIT be 0;
repeat through banlist begin;
let CHILL be 0;
let FB be the exclude entry;
if the number of entries in BANS >= the number of entries in FB begin;
repeat with B running through FB begin;
if B is not listed in BANS, now CHILL is CHILL + 1;
end repeat;
if CHILL is 0, now BADSHIT is BADSHIT + 1;
end if;
end repeat;
if BADSHIT is 0, now FINE is 1;
if BADSHIT > 0, remove Z from BANS;
end while;
decide on Z;
pop-count is a number that varies. pop-count is 1.
poplist is a list of texts that varies.
To say noreppop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
[if bannery is true begin;
now Z is bancheck N;
end if;]
while Z is listed in poplist begin;
now Q is a random number between 1 and X;
now Z is entry Q of N;
[if bannery is true begin;
now Z is bancheck N;
end if;]
end while;
[if bannery is true, add Z to bantrack;]
add Z to poplist;
if a-coming is true begin;
let F be character number 1 in Z;
if F matches the regular expression "<AEIOUaeiou>" begin;
now Z is "n [Z]";
now a-coming is false;
otherwise;
now Z is " [Z]";
now a-coming is false;
end if;
end if;
say Z;
To say anreppop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
[if bannery is true begin;
now Z is bancheck N;
end if;]
while Z is listed in poplist begin;
now Q is a random number between 1 and X;
now Z is entry Q of N;
[if bannery is true begin;
now Z is bancheck N;
end if;]
end while;
[if bannery is true, add Z to bantrack;]
add Z to poplist;
now Z is the substituted form of Z;
let F be character number 1 in Z;
if F matches the regular expression "<AEIOUaeiou>" begin;
now Z is "an [Z]";
now a-coming is false;
otherwise;
now Z is "a [Z]";
now a-coming is false;
end if;
say Z;
[let Z be the number of entries in N;
if pop-count < Z begin;
now pop-count is pop-count + 1;
otherwise;
now pop-count is 1;
end if;
say entry pop-count in N.]
[Use with caution; this will fail loudly if the list is too small. I think it's not working properly; may need to do some tests.]
The temp-text is some text that varies.
To say holdpop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
now pop-count is Q;
say Z;
add Z to usednames;
now the temp-text is Z;
the current boss is some text that varies.
To say bosspop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
now pop-count is Q;
let Z be entry Q of N;
now Z is the substituted form of Z;
now the current boss is Z;
say Z;
To say uppop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
[if bannery is true begin;
now Z is bancheck N;
end if;]
let XZ be the substituted form of Z;
let XA be character number 1 in XZ;
let XB be XA in upper case;
replace character number 1 in XZ with XB;
if a-coming is true begin;
let F be character number 1 in XZ;
if F matches the regular expression "<AEIOUaeiou>" begin;
say "n ";
otherwise;
say " ";
end if;
now a-coming is false;
end if;
say XZ;
To say titlepop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
now Z is the substituted form of Z;
let XZ be Z in title case;
if a-coming is true begin;
let F be character number 1 in XZ;
if F matches the regular expression "<AEIOUaeiou>" begin;
say "n ";
otherwise;
say " ";
end if;
now a-coming is false;
end if;
say XZ;
To say allcapspop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
let XZ be Z in upper case;
say XZ;
To say downpop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
let XZ be the substituted form of Z;
let XA be character number 1 in XZ;
let XB be XA in lower case;
replace character number 1 in XZ with XB;
if a-coming is true begin;
let F be character number 1 in XZ;
if F matches the regular expression "<AEIOUaeiou>" begin;
say "n ";
otherwise;
say " ";
end if;
now a-coming is false;
end if;
say XZ;
To say alldownpop (N - a list of texts):
let X be the number of entries in N;
let Q be a random number between 1 and X;
let Z be entry Q of N;
now Z is the substituted form of Z;
let XZ be Z in lower case;
if a-coming is true begin;
let F be character number 1 in XZ;
if F matches the regular expression "<AEIOUaeiou>" begin;
say "n ";
otherwise;
say " ";
end if;
now a-coming is false;
end if;
say XZ;
usednames is a list of texts that varies. [usednames is {}. DOING THIS RUINS SHIT.]
blocknames is a list of texts that varies.
To say namepop (N - a list of texts):
let Z be the substituted form of "[pop N]";
let P be the number of entries in usednames;
if P > 0 and a random chance of 1 in 4 succeeds begin;
sort usednames in random order;
let Q be entry 1 from usednames;
remove Q from usednames;
say Q;
otherwise;
say Z;
add Z to usednames;
end if;
[this ruins everything and I can't tell how; try again a different way
say "ONE";
now pop-count is 1;
if the number of entries in usednames > 0 and a random chance of 1 in 2 succeeds begin;
say "TWO";
sort usednames in random order;
say "THREE";
let P be entry 1 of usednames;
say "FOUR";
add P to blocknames;
say "REPEAT (usednames is [usednames])[br]";
say P;
otherwise;
let Z be 0;
while Z is 0 begin;
sort N in random order;
let V be entry 1 in N;
let Q be the substituted form of V;
if Q is listed in blocknames begin;
say "BLOCK (blocknames is [blocknames])[br]";
do nothing;
otherwise if Q is listed in usednames;
add Q to blocknames;
say Q;
now Z is 1;
say "USED (blocknames is [blocknames])[br]";
otherwise;
add Q to usednames;
say Q;
now Z is 1;
say "NOT USED (blocknames is [blocknames])[br]";
end if;
end while;
end if;]
banlist is a table name that varies.
bantrack is a list of texts that varies.
bannery is a truth state that varies. bannery is false.
To say ban (foo - a table name):
now bannery is true;
now banlist is foo;
To say ban off:
now bantrack is {};
now bannery is false;
Sing-last is a number that varies.
[0 = neutral
1 = singular
2 = plural]
Plural-reckoned is a truth-state that varies. Plural-reckoned is false.
To say sing:
now sing-last is 1;
Sing-flip is a truth-state that varies. Sing-flip is false.
To say flipsing:
if sing-last is 2 begin;
now sing-last is 0;
now sing-flip is true;
end if;
To say flipoff:
if sing-flip is true begin;
now sing-last is 2;
now sing-flip is false;
end if;
To say plure:
now sing-last is 2;
now plural-reckoned is false;
To say is-are:
if sing-last is 2 begin;
say "are";
otherwise;
say "is";
end if;
now sing-last is 0;
now plural-reckoned is true;
To say reckon:
now plural-reckoned is true;
To say s:
if plural-reckoned is false and sing-last is 2, say "s";
now plural-reckoned is true;
now sing-last is 0;
To say neut:
now sing-last is 0;
To say *es:
if sing-last is 2, say "es";
now plural-reckoned is true;
To say *s:
if sing-last is 2 or sing-last is 0, say "s";
now plural-reckoned is true;
now sing-last is 0;
To say anti-s:
if sing-last is not 2, say "s";
now plural-reckoned is true;
now sing-last is 0;
To say *f:
if sing-last is 2, say "ves";
if sing-last is 1 or sing-last is 0, say "f";
now plural-reckoned is true;
To say *ies:
if sing-last is 2, say "ies";
if sing-last is 1 or sing-last is 0, say "y";
now plural-reckoned is true;
To say *en:
if sing-last is 2, say "en";
now plural-reckoned is true;
To say *man:
if sing-last is 1 or sing-last is 0, say "man";
if sing-last is 2, say "men";
now plural-reckoned is true;
To say *fe:
if sing-last is 1 or sing-last is 0, say "fe";
if sing-last is 2, say "ves";
now plural-reckoned is true;
to say *ices:
if sing-last is not 2, say "ex";
if sing-last is 2, say "ices";
now plural-reckoned is true;
now sing-last is 0;
to say *ix:
if sing-last is not 2, say "ix";
if sing-last is 2, say "ices";
now plural-reckoned is true;
now sing-last is 0;