?(?-) (Utils) <> (print ?x) (?(?: ?:) ?x) ?(?-) (Sight) <> (print-sentence (?q ?r)) (?(?: ?:) ?q\s print-sentence ?r) <> (print-sentence ()) (?(?: ?:) \n) <> (print-list ?a ((:?x ?X) ((:?y ?Y) ((:?z ?Z) ?r)))) (print (You ?a a ?x, a ?y and a ?z.\n)) <> (print-list ?a ((:?x ?X) ((:?y ?Y) ()))) (print (You ?a a ?x and a ?y.\n)) <> (print-list ?a ((:?x ?X) ())) (print (You ?a a ?x.\n)) <> (print-list ?a ()) () <> print-prompt (?(?: ?:) (\n|\s)) <> (:?p ((sight > $ :?V ?C) ?r)) ( print (\nYou are a ?V in a ?p.\n) print-list see ?r print-list carry ?C print-note :?p print-prompt ((> $ :?V ?C) ?r) ) ?(?-) (Cleanup articles) <> ((note ?q) remove-articles parse) ((note ?q) parse-special) <> ((?x ?r) remove-articles) (clean ?r (?x ())) <> (clean (the ?r) ?q) (clean ?r ?q) <> (clean (a ?r) ?q) (clean ?r ?q) <> (clean (an ?r) ?q) (clean ?r ?q) <> (clean (?w ?r) ?q) (clean ?r (?w ?q)) <> (clean () ?q) (flip () ?q) <> (flip ?q (?w ?r)) (flip (?w ?q) ?r) <> (flip ?q ()) ?q ?(?-) (Join words) <> ((?v (?a (?b ()))) parse) ((?v (?a\s?b ())) parse) <> ((?v (?a (?b (in ?r)))) parse) ((?v (?a\s?b (in ?r))) parse) <> ((?v (?a (in (?b (?c ()))))) parse) ((?v (?a (in (?b\s?c ())))) parse) ?(?-) (Physics) <> ((-> ?q :?q ?c)) ((<- ?q :?q ?c)) <> ((-> ?q :?V ?C) ((:?v ?c) ?r)) ((:?V ?C) ((-> ?q :?v ?c) ?r)) <> ((-> ?q :?V ?C) ()) ((<- ?q :?V ?C) ()) <> ((:?V ?C) ((<- ?q :?q ?c) ?r)) ((<- ?q :?q ?c) ((:?V ?C) ?r)) <> ((:?V ?C) ((<- ?q :?v ?c) ?r)) ((<- ?q :?v ?c) ((:?V ?C) ?r)) ?(?-) (Create) <> (((create (?q ())) parse sight > $ :?V ?C) ?r) ( print (You created a ?q.\n) (sight > $ :?V ?C) ((:?q ()) ?r) ) ?(?-) (Become) <> (((become (?q ())) parse sight > $ :?V ?C) ()) ( print (You don't see any vessels.\n) (sight > $ :?V ?C) () ) <> (((become (?q ())) parse sight > $ :?V ?C) ((:?v ?c) ?r)) ( ((become ?q) wait :?V ?C) ((-> ?q :?v ?c) ?r) ) <> (((become ?v) wait :?V ?C) ((<- ?v :?v ?c) ?r)) ( print (You became the ?v.\n) (sight > $ :?v ?c) ((:?V ?C) ?r) ) <> (((become ?q) wait :?V ?C) ((<- ?q :?v ?c) ?r)) ( print (You don't see a ?q.\n) (sight > $ :?V ?C) ((:?v ?c) ?r) ) ?(?-) (Enter) <> (((enter (?q ())) parse sight > $ :?V ?C) ()) ( print (You don't see any vessels.\n) (sight > $ :?V ?C) () ) <> (((enter (?q ())) parse sight > $ :?V ?C) ((:?v ?c) ?r)) ( ((enter ?q) wait :?V ?C) ((-> ?q :?v ?c) ?r) ) <> (((enter ?v) wait :?V ?C) ((<- ?v :?v ?c) ?r)) ( print (You entered the ?v.\n) ((:?v ((sight > $ :?V ?C) ?c)) ?r) ) <> (((enter ?q) wait :?V ?C) ((<- ?q :?v ?c) ?r)) ( print (You don't see a ?q.\n) (sight > $ :?V ?C) ((:?v ?c) ?r) ) ?(?-) (Leave) <> (((:?p (((leave ()) parse sight > $ :?V ?C) ?r)) ?a)) ( print (You left the ?p.\n) (sight > $ :?V ?C) ((:?p ?r) ?a) ) <> ((leave ?q) parse) ( print (You cannot leave.\n) ) ?(?-) (Take) <> (((take (?q ())) parse sight > $ :?V ?C) ()) ( print (You don't see any vessels.\n) (sight > $ :?V ?C) () ) <> (((take (?q ())) parse sight > $ :?V ?C) ((:?v ?c) ?r)) ( ((take ?q) wait :?V ?C) ((-> ?q :?v ?c) ?r) ) <> (((take ?v) wait :?V ?C) ((<- ?v :?v ?c) ?r)) ( print (You took the ?v.\n) (sight > $ :?V ((:?v ?c) ?C)) ?r ) <> (((take ?q) wait :?V ?C) ((<- ?q :?v ?c) ?r)) ( print (You don't see a ?q.\n) (sight > $ :?V ?C) ((:?v ?c) ?r) ) ?(?-) (Drop) <> (((drop (?q ())) parse sight > $ :?V ())) ( print (You don't carry any vessels.\n) (sight > $ :?V ()) ) <> (((drop (?q ())) parse sight > $ :?V ((:?v ?c) ?C))) ( ((drop ?q) wait :?V ((-> ?q :?v ?c) ?C)) ) <> (((drop ?v) wait :?V ((<- ?v :?v ?c) ?C)) ?r) ( print (You dropped the ?v.\n) (sight > $ :?V ?C) ((:?v ?c) ?r) ) <> (((drop ?q) wait :?V ((<- ?q :?v ?c) ?C)) ?r) ( print (You don't carry a ?q.\n) (sight > $ :?V ((:?v ?c) ?C)) ?r ) ?(?-) (Move) <> (((move ?a ?b) wait :?V ?C) ((<- ?a :?a ?c) ((:?b ?d) ?r))) ( print (You moved the ?a in the ?b.\n) (sight > $ :?V ?C) ((:?b ((:?a ?c) ?d)) ?r) ) <> (((move ?a ?b) wait :?V ?C) ((<- ?b :?b ?c) ?r)) ( ((move ?a ?b) wait :?V ?C) ((-> ?a :?b ?c) ?r) ) <> (((move ?a ?b) wait :?V ?C) ((<- ?b :?B ?c) ?r)) ( print (You don't see a ?b.\n) (sight > $ :?V ?C) ((:?B ?c) ?r) ) <> (((move ?a ?b) wait :?V ?C) ((<- ?a :?B ?c) ?r)) ( print (You don't see a ?a.\n) (sight > $ :?V ?C) ((:?B ?c) ?r) ) <> (((move (?a (in (?b ())))) parse sight > $ :?V ?C) ((:?v ?c) ?r)) ( ((move ?a ?b) wait :?V ?C) ((-> ?b :?v ?c) ?r) ) ?(?-) (Transform) <> ((transform (?q ())) parse sight > $ :?V) ( print (You transformed into a ?q.\n) sight > $ :?q ) ?(?-) (Note) <> (:?p (((note ?n) parse-special sight > $ :?V ?C) ?r)) ( >< (print-note :?p) >< (print-note) <> (print-note :?p) (print-sentence ?n :?p) <> (print-note) () :?p ((sight > $ :?V ?C) ?r) ) <> ((quit ?q) parse sight > $) ( ?(?: ?:) (You fell asleep.\n) ) ?(?-) (Input loop) <> (() parse) () <> ((?x ?q) parse) (print (Unknown action: ?x \n)) <> (() input) () <> (?x input) ( ?(?: ?:) \n ?(?* ((?*))) ?x remove-articles parse ) <> (?~ $ :?V) ( (?~) input sight > $ :?V ) (:library ((sight > $ :ghost ()) ((:haunted\shouse ((:teapot ((:moth ()) ())) ())) ())))