Skip to content

Instantly share code, notes, and snippets.

@jbz
Created March 27, 2012 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbz/2219134 to your computer and use it in GitHub Desktop.
Save jbz/2219134 to your computer and use it in GitHub Desktop.
Microwaving
[microwaving]
Microwaving is an action applying to one thing.
Understand "microwave [something]" as microwaving.
Understand "cook [something]" as microwaving.
Understand "heat [something]" as microwaving.
Understand "reheat [something]" as microwaving.
Check microwaving:
Unless the microwave oven is in the location, say "How do you propose to do that?" instead;
Unless the microwave is empty:
Unless the noun is in the microwave, say "There's no room in the microwave." instead;
if the noun is visible, continue the action.
Carry out microwaving:
say "ZAP!";
unless the noun is in the microwave oven:
try opening the microwave oven;
try inserting the noun into the microwave oven;
unless the microwave oven is closed:
try silently closing the microwave oven;
let L be the list of objects inside the microwave oven;
carry out the cooking activity with entry 1 of L;
[cooking activity]
Cooking something is an activity.
Rule for cooking something (called target):
unless the side panel is fried:
say "A light comes on in the microwave and it begins to hum.";
if the target is working:
say "[fryDescription][line break]";
now the target is fried;
otherwise if the target is cold:
say "[cookDescription][line break]";
now the target is hot;
say "A few moments later there is a loud [bold type]BING![roman type] and the microwave stops.";
otherwise:
say "The microwave appears to be dead."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment