Hybrid Choices

version 7 by AW Freyr

  • Home page
  • Beginning
  • Previous
  • Next



  • Part - Showing Choices
    Table of Currently Available Choices
    index  decision  choice-order  
    (number)  (object)  (number)  
    with 32 blank rows.  
    Page-turning relates various pages to various pages.
    The verb to turn to (he turns to, they turn to, he turned to, it is turned to, it is turning to) implies the page-turning relation.
    The verb to be for implies the reversed page-turning relation.
    To clear choices:
        blank out the whole of Table of Currently Available Choices.
    Choice-displaying something is an activity on an object.
    The assigned index is a number that varies.
    [To say note dead-end for (X - a choice):
        if in cyoa debug mode:
            if the next page of X offers no choices or the next page of X passes to nothing:
                say "**".]
    [EXPERIMENTAL]
    Choice-priority is an object based rulebook producing a number.
    Last choice-priority rule:
        rule succeeds with result 50.
        
    To populate choice list with (n - an object):
        if n is a decision listed in the table of currently available choices, stop;
        choose a blank row from the table of currently available choices;
        now the decision entry is n;
        now the choice-order entry is the number produced by the choice-priority rules for n.
    To populate choice list with (n - a description of objects):
        repeat with the item running through n:
            populate choice list with item.
    To populate choice lists for (n - a page):
        repeat with K running through pages turned to by N:
            follow the choice-switch rules for K;
            unless rule failed:
                populate choice list with K;
        sort the table of currently available choices in choice-order order;
        repeat through the table of currently available choices:
            increment assigned index;
            now the index entry is the assigned index.
    Rule for choice-displaying a page (called X) (this is the print choice description rule):
        say "[cdesc of X]" (A).
    Rule for choice-displaying an object (called X) (this is the print choice descriptions for objects rule):
        say "[X]" (A).
    Displaying available decisions of something is an activity on pages.
    Rule for displaying available decisions of a page (called N) (this is the display all choices rule):
        populate choice lists for N;
        repeat through the table of currently available choices:
            say "[index entry]) " (A);
            carry out the choice-displaying activity with the decision entry;
            say "[line break]" (B);
        now the assigned index is 0.
    [/EXPERIMENTAL]
    [Before choice-displaying a page (called X) (this is the bookkeeping tasks whilst choice displaying rule):
        increment the assigned index;
        choose a blank row from the table of currently available choices;
        now the index entry is the assigned index;
        now the decision entry is X.
    Before choice-displaying a page (this is the show choice number rule):
        say "[assigned index]) ".
    Rule for choice-displaying a page (called X) (this is the print choice description rule):
        say "[cdesc of X][line break]".
    Displaying available decisions of something is an activity on pages.
    Rule for displaying available decisions of a page (called N):
        clear choices;
        let F be a truth state;
        if N turns to a page:
            repeat with K running through pages turned to by N:
                follow the choice-switch rules for K;
                unless the rule failed:
                    carry out the choice-displaying activity with K;
            if F is true:
                say line break;
        now the assigned index is 0.]