Interactive Poetry

version 2 by Michael Bacon

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 4 - Word choosing

    Understand "[text]" as choosing. Choosing is an action applying to one topic.
    Carry out choosing:
        let the found row be the row that matches the topic understood in the table of possible lines;
        [say "1";] [ debugging -- please ignore ]
        if the found row is not 0 begin;
            [say "2";] [ debugging -- please ignore ]
            choose row the found row from the table of possible lines;
            let X be the line entry;
            let T be the topic entry as a number;
            [say "3";] [ debugging -- please ignore ]
            if the line-number entry < the current line, change the current line to the line-number entry; [ backs up ]
            [say "4";] [ debugging -- please ignore ]
            if the current line is the line-number entry begin;
                [say "5";] [ debugging -- please ignore ]
                choose row current line in the table of selected lines;
                change the line entry to X;
                change the topic entry to T as a topic;
                increase the current line by 1;
                rule succeeds;
            otherwise;
                now the unknown words message is the line corresponding to an informational message of word-not-valid-yet in the table of informational messages ;
                rule fails;
            end if;
        end if;
        ; [ Everything from here down is probably obsolete. ]
        [say "6";] [ debugging -- please ignore ]
        change the found row to the row that matches the topic understood in the table of selected lines;
        [say "7";] [ debugging -- please ignore ]
        if the found row is 0 begin;
            now the unknown words message is the line corresponding to an informational message of word-not-valid in the table of informational messages;
            rule fails;
        otherwise;
            [now the unknown words message is "(DEBUGGING: chose an old line.)";]
            rule succeeds; [ This branch might now be obsolete. ]
        end if;