Repeat Through a Rulebook

version 4 by Ron Newcomb

  • Home page
  • Beginning
  • Previous



  • Example: * "Rulebook Repeat Test" - Try it out!

        "Rulebook Repeat Test"

        Include Repeat Through a Rulebook by Ron Newcomb.
        
        Test me with " l / take rule / l / take rule / l / x oddball / take rule / l / x oddball ".
        
        Spot is room. "This is a rather bizarre place. Try taking a rule." An oddball is in spot. Understand "rule" as an oddball.
        
        X is a number that varies.
        
        Last carry out looking (this is the Test Rulebook Loop rule):
            say "The Carry Out Looking rules currently has [the number of rules in the carry out looking rules] rules:[line break]";
            repeat with the law of optics running through the carry out looking rules begin;
                say "* [the law of optics]";
                if the law of optics is listed in the check taking rules, say " (also in the check taking rules because it was [the reason the rule ran])";
                say line break;
            end repeat.
        
        The Test Rulebook Loop rule is listed in the check taking rules.
        
        Instead of taking the oddball:
            say "Removing the next Look rule.";
            now x is x + 1;
            if x is 2, say "Moving the paragraphs-about-objects rule to last place.".
        
        Instead of examining the oddball:
            say "Every combination of Check Taking with Carry Out Looking:[line break]";
            repeat with the law of optics running through the carry out looking rules begin;
                repeat with the physical reality rule running through the check taking rules begin;
                    say "[the law of optics], [the physical reality rule].";
                end repeat;
            end repeat.
        
        Procedural rule:
            if x > 0, ignore the room description heading rule;
            if x > 1 begin;
                ignore the room description body text rule;
                move the room description paragraphs about objects rule to after the Test Rulebook Loop rule; [ after that rule in both rulebooks ]
            end if;
            if x > 2, ignore the room description paragraphs about objects rule;
            if x > 3, ignore the check new arrival rule.