# Repeat Through a Rulebook

## version 4 by Ron Newcomb

Section - Rules by Number

[ TODO: test to see if "rulebook variable" versions are needed ]

To decide which rule is rule number/-- (n - number) of/in/for the/a/an/-- unmodified (ar - a rulebook):
(- (NthOfUnmodifiedRulebook({n},{ar})) -).

To decide which rule is rule number/-- (n - number) of/in/for the/a/an/-- modified/-- (ar - a rulebook):
(- (NthOfRulebook({n},{ar})) -).

To decide which rule is the/a/an/any/-- random rule/member/members in/for/of/from/-- (RB - a rulebook):
decide on rule number (a random number from 1 to the number of rules in RB) in RB.

To decide which number is number of rulebooks: (- NumberOfRulebooks() -).
To decide which rulebook is (n - a number) as rulebook: (-{n}-).
To decide which text is printed name of/for rulebook number/-- (x - a number): (- GetRulebookName({x}) -).

Include (-
[ NthOfUnmodifiedRulebook n ar;
if (n < 1) return LITTLE_USED_DO_NOTHING_R;
if (n > NumberOfRulesInUnmodRulebook(ar)) return LITTLE_USED_DO_NOTHING_R;
return (rulebooks_array-->(ar))-->(n-1);
];

[ NthOfRulebook n ar temp;
if (n < 1) return LITTLE_USED_DO_NOTHING_R;
if (n > NumberOfRulesInRulebook(ar)) return LITTLE_USED_DO_NOTHING_R;
temp = (rulebooks_array-->(ar))-->(n-1);
PseudoProcessRulebook(temp,0,0,0,(+directly invoked+));
return temp;
];

[ NumberOfRulebooks; return {-value:NUMBER_CREATED(rulebook)} - 1; ];

-).