Tea and Toast — 26 of 31

Maria del Pangolin

Release 1

Section - Free Association

The free association rules are a rulebook producing an object.

We need prompting is a truth state that varies. The thing to be prompted is a thing that varies. The memory threshold is a number that varies. The memory threshold is 6.

Memory chosen for the tchotchke is a truth state that varies. [Measures whether we've found a memory associated with the tchotchke uncovered. If we haven't, then we don't want to foreclose any other memory. We could just check to see whether there's a memory that has a high enough score but that would require running through memories an extra time.]

Definition: A memory is available if the coveredness of it is uncovered.

Every turn (this is the free association rule):

let the chosen memory be the object produced by the free association rules;

if the chosen memory is not nothing:

now the last memory is the chosen memory;

say "[italic type][memory-text of the chosen memory][roman type][paragraph break]";

now the coveredness of the chosen memory is used up;

repeat through the Table of Uncovering:

if the trigger entry is the chosen memory and the coveredness of the unlockable entry is covered:

now the unlockable entry is uncovered;

now the memory threshold is 6;

otherwise:

if the current action is thinking or the current action is thinking about something:

say "Nothing comes to mind.";

if the memory threshold is at least 2:

decrement the memory threshold;

if we need prompting is true:

carry out the prompting activity with the thing to be prompted;

now the clue count is the clue threshold minus 3; [give the player a break from clues after issuing one]

now the things encountered is {}; [and we need to clear the variables]

repeat with quip running through memories:

now the relevance of the quip is 0;

now the tchotchke discovered is the void;

now memory chosen for the tchotchke is false.

The things encountered is a list of things that varies. [Everything encountered during the turn.]

The last memory is an object that varies. [The last memory printed.]

First before (this is the remark the nouns rule): [it's the first before so it runs whenever there's an action, including ones generated by try phrases]

if the noun is a thing:

add the noun to the things encountered, if absent;

if the second noun is a thing:

add the second noun to the things encountered, if absent.

A memory has a number called the relevance. [Defined here because it's used during the free association rules only.]

Definition: A memory is relevant if its relevance is 3 or more. [Relevanter, relevantest.]

[

Every turn when the clue count is at least the clue threshold:

let L be the list of on-stage primed things;

if L is non-empty:

let n be a random number from 1 to the number of entries in L;

carry out the prompting activity with entry n of L.]

First free association rule (this is the do we need prompting rule):

if the clue count is at least the clue threshold and a primed thing is on-stage: [see the clue threshold stuff back in the Is the Player Progressing section]

now we need prompting is true;

otherwise:

now we need prompting is false.

A free association rule (this is the scoring memories rule):

repeat through the Table of Associations:

let the memory in question be the prompt entry;

if the memory in question is available:

if there is an associated memory entry and the associated memory entry is the last memory:

increase the relevance of the memory in question by 4;

if there is an associated thing entry and the associated thing entry is listed in the things encountered:

if the current action is thinking about:

increase the relevance of the memory in question by 6;

otherwise:

increase the relevance of the memory in question by 3;

if we need prompting is true and the relevance of the memory in question is less than 100 and there is an associated thing entry and the associated thing entry is on-stage and the associated thing entry is primed: [this is a flag that, if we need prompting, only memories that are associated with prompts need apply]

increase the relevance of the memory in question by 100;

if we need prompting is false and the tchotchke discovered is not the void and there is an associated thing entry and the associated thing entry is the tchotchke discovered:

increase the relevance of the memory in question by 50;

now memory chosen for the tchotchke is true.

A free association rule when we need prompting is true (this is the reset irrelevant memories rule):

repeat with quip running through memories:

if the relevance of the quip is at least 100:

decrease the relevance of the quip by 99;

otherwise:

now the relevance of the quip is 0. [So if the quip was never associated with one of the things we need prompting about, it gets set to 0.]

The reset irrelevant memories rule is listed after the scoring memories rule in the free association rulebook.

A free association rule (this is the pick a memory rule):

let L be a list of memories;

if we need prompting is true: [we ignore the memory threshold]

repeat with the quip running through available memories:

if the relevance of the quip is at least 1, add the quip to L; [this will only bring up memories that are associated with a relevant thing]

if L is non-empty:

let n be a random number from 1 to the number of entries in L;

let the successful memory be entry n in L;

repeat through the Table of Associations:

if the prompt entry is the successful memory and there is an associated thing entry and the associated thing entry is on-stage and the associated thing entry is primed:

now the thing to be prompted is the associated thing entry;

rule succeeds with result the successful memory; [this should always hit for some row, and if it doesn't, we drop down to the next case where we produce no memory and pick a random primed object to prompt]

now the thing to be prompted is a random on-stage primed thing;

rule succeeds with result nothing;

otherwise if the memory chosen for the tchotchke is true: [we automatically go to a memory associated with the tchotchke, if there is one. Forcing this to be the most relevant memory so other associations can come into play. But we can't just use "the relevantest memory" because that'll force it to be the one that's first in the source code.]

repeat with the quip running through available memories:

unless the relevantest available memory is relevanter than the quip: [this is kind of elegant but probably hellaciously inefficent]

add the quip to L;

if L is non-empty: [this should always be true, since it will work for the relevantest memory, but better safe than sorry]

let n be a random number from 1 to the number of entries in L;

let the successful memory be entry n in L;

rule succeeds with result the successful memory;

otherwise:

repeat with the quip running through available memories:

if the relevance of the quip is at least the memory threshold, add the quip to L;

if L is non-empty:

let n be a random number from 1 to the number of entries in L;

rule succeeds with result entry n in L;

rule succeeds with result nothing. [If we've fallen through to here, we haven't picked a memory.]