Robopuppy Redux

An interactive fiction by J.D. Clemens (2007) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Section C - Immediate performing

[ This will cause all steps of a command to be performed in one turn. ]

Immediate performing is an action applying to one visible thing.
Understand "[nonblank command] now" as immediate performing.

Check immediate performing:
    if Robopuppy is scripted, say "Robopuppy is already performing a command." instead;
    if the learning flag is true, say "Robopuppy is learning a command right now." instead.
    
Instead of Robopuppy trying immediate performing: try immediate performing the noun.

Carry out immediate performing:
    say "You tell Robopuppy to [the message of noun] immediately.[paragraph break]";
    change the command index to 1;
    now Robopuppy is scripted;
    let buffer be indexed text;
    let buffer be "[multiple command output]";
    replace the regular expression "\s" in buffer with " ";
    replace the regular expression "\s\s" in buffer with " ";
    while buffer matches the regular expression "(?<=Robopuppy)(.*?\.\s)Robopuppy" begin;
        replace the regular expression "(?<=Robopuppy)(.*?\.\s)Robopuppy(.*)" in buffer with "\1[one of]He then[or]Next he[or]After that he[or]He now[or]Then he[or]A moment later he[or]Now he[or]He next[in random order]\2";
    end while;
    replace the regular expression "(?<=Robopuppy)(.*?)Robopuppy" in buffer with "\1himself";
    if buffer matches the regular expression "\S", say "[buffer][paragraph break]";
    otherwise say "[run paragraph on]".

To say multiple command output:
    while Robopuppy is scripted repeatedly perform the noun.

Immediate performing is unteachable.