Skip to content

Instantly share code, notes, and snippets.

@jbz
Created February 29, 2012 19:39
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/1943859 to your computer and use it in GitHub Desktop.
Save jbz/1943859 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.
Carry out microwaving:
unless the noun is in the microwave oven:
try opening the microwave oven;
try inserting the noun into the microwave oven;
try closing the microwave oven;
After microwaving:
repeat through Table of Microwaving Things:
if the noun is item entry:
[say "Microwaving [the noun].";]
let the attempt be the result entry;
[now the noun part of the attempt is the noun;]
[say "The attempt is [the attempt].";]
say "[the description entry]";
try the attempt;
break;
repeat through Table of Microwaving Kinds:
if the noun is a kind entry:
let the attempt be the result entry;
say "[the description entry]";
try the attempt;
break;
say "A light comes on in the microwave and it begins to hum loudly. A few moments later there is a loud [bold type]BING![roman type]";
rule succeeds;
Table of Microwaving Things
item result description
coffee the action of heating the coffee "The coffee is now steaming slightly."
solder the action of melting the solder "A hissing noise arises. The solder is now melted into an unusable puddle."
Table of Microwaving Kinds
kind result description
a memory chip the action of frying the memory chip "There is a sizzling noise. The chip is now scorched and smoking slightly."
a broadcast chip the action of frying the broadcast chip "There is a sizzling noise. The chip is now scorched and smoking slightly."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment