Automated Drawers

version 4 by Emily Short

  • Home page
  • Beginning
  • Previous



  • Section 2G - Disambiguation Trick (for Glulx only)
        
    Rule for asking which do you mean when everything matched is a drawer and the number of matched things is greater than three (this is the simplifying drawer choice rule):
        say "You have a choice of drawers from [the list of things which incorporate a matched drawer]. ";
        let started printing be false;
        repeat with item running through things which incorporate a matched drawer:
            say "[The item] has [the number of matched drawers which are part of the item in words][if started printing is false] you might mean[end if]";
            now started printing is true;
            say " ([the list of matched drawers which are part of the item])";
            say ". ";
        say paragraph break.

    [The matchlist testing breaks down when used on a lot of objects at once under the z-machine, which is why we save that feature for Glulx.]

    After searching something which incorporates a drawer (this is the search opens all drawers rule):
        repeat with item running through drawers which are part of the noun:
            if the item is closed:
                try opening the item;
            otherwise:
                try searching the item;
        continue the action.

    Automated Drawers ends here.