Child's Play

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

Chapter 9 - Pre-writing a Paragraph About, Which is a New Activity To Allow Us to Collate Playmates' Paragraphs in Room Descriptions

[Originally this was to be a simple rule added to the carry out looking rulebook, but I7 doesn't handle things properly. I can't mark items that I print something about as already having been mentioned so the "writing a paragraph about" activity doesn't fire, among other problems.]

Pre-writing a paragraph about something is an activity.

A carry out looking rule (this is the room description pre-writing paragraphs about playmates rule):
    let c be the number of playmates in the location;
    if c is greater than 0 begin;
        if c is greater than 1 begin;
            let flag be 0;
            repeat with p running through playmates in the location begin;
                say "[if flag is not 0] and [end if][p]";
                increment flag by 1;
            end repeat;
            say " are here. [run paragraph on]";
        end if;
        repeat with p running through playmates in the location begin;
            carry out the pre-writing a paragraph about activity with p;
        end repeat;
        if c is greater than 1, say note collated-reports;
        say paragraph break;
    end if.

[Don't otherwise mention playmates.]
Rule for writing a paragraph about a playmate (called p):
    now p is mentioned;
    now p is not marked for listing.

The room description pre-writing paragraphs about playmates rule is listed after the room description body text rule in the carry out looking rulebook.

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