Blue Lacuna — 91 of 467

Aaron A. Reed

Release 4

Section - Testing Commands

Auditing is an action out of world applying to nothing. Understand "audit" as auditing. Specific-auditing is an action out of world applying to one thing. Understand "audit [any beat]" as specific-auditing.

Check auditing: if a conversing person is not enclosed by the location, say "Nothing to audit.".

Check specific-auditing: if noun is not a beat, say "You can only audit beats."

Carry out auditing:

try specific-auditing last beat.

Carry out specific-auditing:

now temp-beat-list is { };

analyze noun with indentation 0;

say "[line break]*: Terminal / %: Not in same thread as [noun] / &: suggests nothing / $: spoken.";

let parent be a random thread enclosing noun;

let xor be the list of beats in a random thread enclosing noun;

remove temp-beat-list from xor;

if the number of entries in xor > 0, say "[line break]Beats outside tree: [xor].";

truncate xor to 0 entries;

let xor be the list of keywordless beats in a random thread enclosing noun;

if the number of entries in xor > 0, say "[line break]Beats w/o keyword names: [xor]".

Definition: a beat is printable-keyworded if its keyword name is not "". Definition: a beat is keywordless if its keyword name is "" and something summons it. Definition: a beat is keyworded if it is not keywordless.

[

stop-loop is a number that varies. stop-loop is 0. loop-path is a list of objects that varies.

To loop search with (parent - a list of objects):

repeat with item running through parent begin;

loop process item;

end repeat.

]

[

To loop process (item - a beat):

if item is listed in loop-path begin;

now stop-loop is 1;

add item to loop-path;

say "Endless replace loop found: [loop-path].";

end if;

if stop-loop is 1, stop;

add item to loop-path;

[ if anything is enqueued by item begin;]

[ let Q be a random thing enqueued by item;

loop process Q;]

[ end if; ]

[ if anything is enqueued by item, loop process a random thing enqueued by item;]

[ loop search with the list of things enqueued by item;]

[ add the list of things enqueued by item to newlist; ]

[ let newlist be the list of things enqueued by item;

loop search with newlist;

if the number of entries in newlist > 1 begin;

now stop-loop is 1;

say "Error: [item] enqueues more than 1 thing ([newlist]).";

end if;]

[ now newlist is { };

add every thing item replaces to newlist;

loop search with newlist;

if the number of entries in newlist > 1 begin;

now stop-loop is 1;

say "Error: [item] is replaced by more than 1 thing ([newlist]).";

end if;

now newlist is { };

add every thing that item summons to newlist;

if the number of entries in newlist > 0, loop search with newlist;]

let N be the number of entries in loop-path;

remove entry N from loop-path.

]

To say (N - a number) spaces:

repeat with index running from 1 to N

begin;

say " | ";

end repeat.

temp-beat-list is a list of objects that varies.

[ [if anything replaces target](replaced by [a random beat that replaces target])[end if]]

To analyze (target - a beat) with indentation (indent - a number), indicating suggestion:

say ( indent ) spaces;

say "+ ";

if indicating suggestion, say "(suggests) [run paragraph on]";

if target is listed in temp-beat-list begin;

say "[target][line break]";

stop;

end if;

while target is not last beat and target is spoken and something replaces target begin;

say "[d]replacing [target]:[x]";

now target is a random thing that replaces target;

end while;

if target is listed in temp-beat-list begin;

say "[target][line break]";

stop;

end if;

add target to temp-beat-list, if absent;

let targettitle be "[target]" in upper case;

say "[if target is terminal]*[end if][if number of things suggested by target is 0 and number of things enqueued by target is 0 and target is substantial and target is interstitial]&[o][end if][if a random thread enclosing target is not a random thread enclosing noun]%[o][end if][if target is spoken]$[d][end if][targettitle][x]";

say ": [if target is repeatable](R)[end if][if number of things summoned by target > 0]summons [number of things summoned by target] beats [end if][run paragraph on]";

let stop_flag be 0;

if a beat replaces target begin;

let Q be a random beat that replaces target;

while Q is replaced by a beat and stop_flag is 0 begin;

let replacer be a random beat that replaces Q;

if replacer is target or a random beat enqueued by Q is target begin;

say "[o]ERROR: infinite replace loop.[x]";

now stop_flag is 1;

otherwise;

let Q be replacer;

end if;

end while;

end if;

if target is repeatable and target suggests a repeatable beat, say "[o]WARNING: repeatable suggests repeatable[x]";

let stop_flag be 0;

if number of things enqueued by target > 0 begin;

say " --> ";

let newtarget be a random thing enqueued by target;

if newtarget is not listed in temp-beat-list, analyze newtarget with indentation indent;

otherwise say "[newtarget][line break]";

otherwise;

say "[line break]";

end if;

if indent < 10 begin;

repeat with item running through things summoned by target begin;

analyze item with indentation ( indent + 1 ) ;

end repeat;

if number of things suggested by target > 0 begin;

analyze a random thing suggested by target with indentation ( indent + 1 ), indicating suggestion;

end if;

otherwise;

say ( indent + 1) * 4 spaces;

if number of things summoned by target > 0, say "...[run paragraph on][number of things summoned by target] more[line break]";

end if.