The Wizard’s Adventure Game

WONSEOK CHAE
2 min readNov 24, 2016

--

Today was a day I did my homework. I read “Land of Lisp” a few years ago and I always wanted to implement a simple code I saw there. This remarkable book introduced a simple text adventure game (The Wizard’s Adventure Game) to learn Lisp’s text manipulation. I ported this example to Python.

Game description: You’ll explore the wizard’s house.

From “Land of Lisp”

You can check out my notebook here! The below shows how a game ends :)

>>> gameREPL()
you are in a beautiful garden. there is a well in front of you. there is a door going east from here. you see a chain on the floor. you see a frog on the floor.
inventory
[]
help
['look', 'walk', 'pickup', 'inventory', 'weld', 'dunk', 'splash', 'help']
pickup frog
you are now carrying the frog.
pickup chain
you are now carrying the chain.
inventory
['frog', 'chain']
walk east
you are in the living-room. a wizard is snoring loudly on the couch there is a door going west from here. there is a ladder going upstairs from here. you see a whiskey on the floor. you see a bucket on the floor.
pickup bucket
you are now carrying the bucket.
walk upstairs
you are in the attic. there is a giant welding torch in the corner. there is a ladder going downstairs from here.
weld chain bucket
the chain is now securely welded to the bucket.
walk downstairs
you are in the living-room. a wizard is snoring loudly on the couch there is a door going west from here. there is a ladder going upstairs from here. you see a whiskey on the floor. you see a bucket on the floor.
walk west
you are in a beautiful garden. there is a well in front of you. there is a door going east from here. you see a chain on the floor. you see a frog on the floor.
help
['look', 'walk', 'pickup', 'inventory', 'weld', 'dunk', 'splash', 'help']
dunk bucket well
the bucket is now full of water
walk east
you are in the living-room. a wizard is snoring loudly on the couch there is a door going west from here. there is a ladder going upstairs from here. you see a whiskey on the floor. you see a bucket on the floor.
splash bucket wizard
the wizard awakens and sees that you stole his frog. he is so upset he banishes you to the netherworlds- you lose! the end.

--

--