Child's Play

An interactive fiction by Stephen Granade (2007) - the Inform 7 source text

VOLUME 4 - On Other People

To decide if (kid - a person) is alone:
    if a playmate in the location of the kid is not the kid, decide no;
    decide yes.

To decide if (kid - a person) is not alone: if kid is alone, decide no;
    decide yes.

[When a kid wanders, there's a chance that they'll wander back towards each other.]
To have (kid - a person) wander:
    let position be the location of the kid;
    if the kid is alone and 2 out of 3 begin;
        let leader be a random playmate who is not the kid;
        let goal be the location of leader;
    otherwise;
        let goal be a random room which is adjacent to position;
    end if;
    let way be the best route from the position to the goal;
    if way is not nothing, try kid going way;

After printing the name of something which is gnawed by someone (called the chewer) while examining: say " (which [it-they of the chewer] [if the chewer is the player]are[otherwise][is-are][end if] totally chewing on)".

To say drop: say "[one of]get rid of[or]drop[or]let go of[purely at random]".

To say drops: say "[one of]gets rid of[or]drops[or]lets go of[purely at random]".

To say takes: say "[one of]takes[or]grabs[or]snatches[purely at random]".

The source code to Child's Play is licensed under a Creative Commons NonCommercial Sampling Plus 1.0 License.