Child's Play

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

Chapter 4 - Scoring
The maximum score is 100.
Table of Achievements
Points   Citation
a number   text
with 16 blank rows;
To record (P - a number) points for (T - text):    if the number of blank rows in the Table of Achievements is less than 1    begin;    report bug "There are not enough blank rows in the Table of Achievements.";    otherwise;    choose a blank row in the Table of Achievements;    change the points entry to P;    change the citation entry to T;    end if;    award P points; Requesting the full score is an action out of world. Understand "full" or "full score" or "fullscore" as requesting the full score. Carry out requesting the full score: consider the print the full score rule. This is the print the full score rule:    say "You have like [the score] points out of [maximum score]";    if the score is greater than 0    begin;    say ". Here is how you got them:[paragraph break]";    repeat through the Table of Achievements begin;    say " [points entry] for [citation entry][line break]";    end repeat;    otherwise;    say ".";    end if; The print the full score rule is listed instead of the print final score rule in the for printing the player's obituary rulebook. [You can't throw in an "after requesting the score" rule because, for whatever reason, the requesting the score rulebook appears to stop the action after the carry out actions. So instead I replace that rule.] The first carry out requesting the score rule: say "You have like [the score] points out of [maximum score], in [turn count] turns.[run paragraph on]" The announce the score rule is not listed in the carry out requesting the score rulebook. [Another oddity: if I just have the first carry out rule above and the rule immediately following w/o running the paragraph on in both, I get an extra paragraph break when you request your score for the second time.] Carry out requesting the score for the first time: say " (There's a fuller list of your accomplishments, you can see it by typing FULL SCORE.)[run paragraph on]" The last carry out requesting the score rule: say line break.

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