Hybrid Choices

version 7 by AW Freyr

  • Home page
  • Beginning
  • Previous
  • Next



  • Part - CYOA Mode
    The CYOA mode is a truth state that varies.
    To decide if in CYOA mode:
        if CYOA mode is true:
            decide yes;
        decide no.
    To decide if not in CYOA mode:
        if CYOA mode is true:
            decide no;
        decide yes.
    To execute page turning:
        let passed pages be a list of pages;
        let finish condition be a truth state;
        [if the description of X is not "":
            say the description of X;
            say paragraph break;]
        while the finish condition is false:
            follow the page-switch rules for the current page;
            [if a page relates to the current page by the page-flipping relation:]
            if the current page flips to a page (called p1):
                add the current page to the passed pages;
                unless the current page is a one-off and the current page is previously displayed:
                    if in cyoa debug mode:
                        say "[bracket]Working through [current page] to [destination page]...[close bracket]";
                    if the description of the current page is not "":
                        say the description of the current page;
                        say paragraph break;
                    follow the page-output rules for the current page;
                    follow the page-toggle rules for the current page;
                    now the displayed boolean of the current page is true;
                else if in cyoa debug mode:
                    say "[bracket]Skipping past [current page]...[close bracket]";
                now the current page is p1;
                if the current page is listed in the passed pages:
                    if in cyoa debug mode:
                        say "[bracket]It appears that you may have accidently created an infinite loop by following a previous page. I am now failsafing to the previous page.[close bracket]";
                    now the current page is the previous page;
                    break;
            else:
                now the finish condition is true;
                now the displayed boolean of the current page is true;
                if in cyoa debug mode:
                    say "[bracket]Working through [current page]...[close bracket]";
                follow the page-toggle rules for the current page;
                if the current page is a dead-end:
                    if the description of the current page is not "":
                        say the description of the current page;
                        say paragraph break;
                    follow the page-output rules for the current page;
                    now the current page is the previous page;
                    follow the page-toggle rules for the current page;
                    follow the page-output rules for the current page.
    To turn to (x - a page):
        now the previous page is the current page;
        now the current page is X;
        execute page turning;
        try looking.
    To switch to CYOA at (x - a page), without looking:
        now the current page is X;
        now CYOA mode is true;
        set choice-window;
        execute page turning;
        unless without looking:
            try looking.
    To switch from CYOA, without looking:
        now CYOA mode is false;
        unset choice-window;
        unless without looking:
            try looking.