Repeat Through a Rulebook

version 4 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Rule Loops, unmodified

    [ the adjective "unmodified" means ignoring the procedural rules, and is not optional if you want this variation ]

    To repeat with (loopvar - nonexisting rule variable) running through/thru the/a/an/-- unmodified (ar - a rulebook) begin -- end:
    (- {-allocate-storage:LoopingThruRulebooks} ! {-advance-counter:LoopingThruRulebooks} ! don't delete this comment; it actually still advances the counter, which is important because -->0 means something way different than -->1 or -->2
        I7_ST_LoopingThruRulebooks-->{-counter:LoopingThruRulebooks} = 0;
        for ( {loopvar} = (rulebooks_array-->{ar})-->(I7_ST_LoopingThruRulebooks-->{-counter:LoopingThruRulebooks})
            : {loopvar} ~= NULL
            : {loopvar} = (rulebooks_array-->{ar})-->(++(I7_ST_LoopingThruRulebooks-->{-counter:LoopingThruRulebooks}))
            ) -).

    To repeat with (loopvar - nonexisting rule variable) running through/thru the/a/an/-- unmodified (ar - a rulebook variable) begin -- end:
    (- {-allocate-storage:LoopingThruRulebooks} ! {-advance-counter:LoopingThruRulebooks} ! don't delete this comment; it actually still advances the counter, which is important because -->0 means something way different than -->1 or -->2
        I7_ST_LoopingThruRulebooks-->{-counter:LoopingThruRulebooks} = 0;
        for ( {loopvar} = (rulebooks_array-->{ar})-->(I7_ST_LoopingThruRulebooks-->{-counter:LoopingThruRulebooks})
            : {loopvar} ~= NULL
            : {loopvar} = (rulebooks_array-->{ar})-->(++(I7_ST_LoopingThruRulebooks-->{-counter:LoopingThruRulebooks}))
            ) -).

    To decide if (R - a rule) is/are currently/-- listed in/for the/a/an/-- unmodified (rb - a rulebook):
        (-IsRuleInUnmodifiedRulebook({R}, {rb})-).

    To decide if (R - a rule) is/are currently/-- not currently/-- listed in/for the/a/an/-- unmodified (rb - a rulebook):
        if R is listed in the unmodified rb, decide no; otherwise decide yes.

    To decide which number is number of rules of/in/for the/an/a/-- unmodified (rb - a rulebook):
        (- (NumberOfRulesInUnmodRulebook({rb})) -).

    Include (-
    [ IsRuleInUnmodifiedRulebook r ar i;
        for(i = 0: (rulebooks_array-->ar)-->i ~= NULL: i++)
            if (r == (rulebooks_array-->ar)-->i)
                rtrue;
        rfalse;
    ];

    [ NumberOfRulesInUnmodRulebook ar i;
        for (i = 0 : (rulebooks_array-->ar)-->i ~= NULL : i++);
        return i;
    ];
    -).