Sample Transcript of "Spider" Prolog Game
David Matuszek, Villanova University

This is a corrected sample transcript from playing "spider.pl". This transcript shows how to play the game "perfectly," with no side trips or errors. Commands entered by the user are in boldface. See the Errata page for notes on how this transcript was produced.


Welcome to SWI-Prolog (Version 3.3.0)
Copyright (c) 1993-1999 University of Amsterdam. All rights reserved.

For help, use ?- help(Topic). or ?- apropos(Word).

?- consult('spider.pl').
% spider.pl compiled 0.00 sec, 12,540 bytes

Yes
?- start.

Enter commands using standard Prolog syntax.
Available commands are:
start.                   -- to start the game.
n.  s.  e.  w.  u.  d.   -- to go in that direction.
take(Object).            -- to pick up an object.
drop(Object).            -- to put down an object.
kill.                    -- to attack an enemy.
look.                    -- to look around you again.
instructions.            -- to see this message again.
halt.                    -- to end the game and quit.

You are in a meadow.  To the north is the dark mouth
of a cave; to the south is a small building.  Your
assignment, should you decide to accept it, is to
recover the famed Bar-Abzad ruby and return it to
this meadow.



Yes
?- s.
You are in a small building.  The exit is to the north.
There is a barred door to the west, but it seems to be
unlocked.  There is a smaller door to the east.

There is a flashlight here.


Yes
?- take(flashlight).
OK.

Yes
?- n.
You are in a meadow.  To the north is the dark mouth
of a cave; to the south is a small building.  Your
assignment, should you decide to accept it, is to
recover the famed Bar-Abzad ruby and return it to
this meadow.



Yes
?- n.
You are in the mouth of a dank cave.  The exit is to
the south; there is a large, dark, round passage to
the east.

There is a key here.


Yes
?- take(key).
OK.

Yes
?- s.
You are in a meadow.  To the north is the dark mouth
of a cave; to the south is a small building.  Your
assignment, should you decide to accept it, is to
recover the famed Bar-Abzad ruby and return it to
this meadow.



Yes
?- s.
You are in a small building.  The exit is to the north.
There is a barred door to the west, but it seems to be
unlocked.  There is a smaller door to the east.



Yes
?- e.
This is nothing but an old storage closet.

There is a sword here.


Yes
?- take(sword).
OK.

Yes
?- w.
You are in a small building.  The exit is to the north.
There is a barred door to the west, but it seems to be
unlocked.  There is a smaller door to the east.



Yes
?- n.
You are in a meadow.  To the north is the dark mouth
of a cave; to the south is a small building.  Your
assignment, should you decide to accept it, is to
recover the famed Bar-Abzad ruby and return it to
this meadow.



Yes
?- n.
You are in the mouth of a dank cave.  The exit is to
the south; there is a large, dark, round passage to
the east.



Yes
?- e.
There is a giant spider here!  One hairy leg, about the
size of a telephone pole, is directly in front of you!
I would advise you to leave promptly and quietly....



Yes
?- u.
You are on top of a giant spider, standing in a rough
mat of coarse hair.  The smell is awful.

There is a ruby here.


Yes
?- take(ruby).
OK.

Yes
?- kill.
You hack repeatedly at the spider's back.  Slimy ichor
gushes out of the spider's back, and gets all over you.
I think you have killed it, despite the continued twitching.

Yes
?- d.
Yecch!  There is a giant spider here, twitching.



Yes
?- w.
You are in the mouth of a dank cave.  The exit is to
the south; there is a large, dark, round passage to
the east.



Yes
?- s.
Congratulations!!  You have recovered the ruby
and won the game.

The game is over. Please enter the "halt." command.



Yes
?-