Computers

version 5 by Emily Short

  • Home page
  • Beginning
  • Previous



  • Section 3 - Input Handling

    Input handling rules are an object-based rulebook.

    An input handling rule for a password lock program (called chosen software) (this is the check for correct passwords rule):
        let N be indexed text;
        let N be "[the topic understood]";
        if N is the password of the chosen software:
            carry out the rewarding successful answering activity with the chosen software;
            rule succeeds;
        otherwise:
            say "[rejection of the chosen software][paragraph break]";
            rule fails.

    An input handling rule for an enumerated multiple-choice program (called chosen software) (this is the pick a number rule):
        let N be indexed text;
        let N be "[the topic understood]";
        repeat through the options table of the chosen software:
            let numero be indexed text;
            let numero be "[index entry]";
            if N is numero:
                follow the effect entry;
                rule succeeds;
        say "[out of bounds response of the chosen software][paragraph break]";
        try examining the chosen software.

    An input handling rule for a multiple-choice program (called chosen software) (this is the pick a choice rule):
        if the topic understood is a topic listed in the options table of the chosen software:
            follow the effect entry;
            rule succeeds;
        otherwise:
            say "[out of bounds response of the chosen software][paragraph break]";
            rule fails.

    An input handling rule for a search engine (called chosen software) (this is the consult software rule):
        try consulting the chosen software about the topic understood instead.

    An input handling rule for an email program (called chosen software) (this is the read email rule):
        if the topic understood is a topic listed in the message table of the chosen software:
            if there is an arrival time entry:
                say "[description entry][paragraph break]";
                now the read entry is true;
                rule succeeds;
        say "No such message is available.";
        rule fails.

    Computers ends here.