CSC 8310   Linguistics of Programming Languages
Dr. David Matuszek
Fall 1998, Villanova University

Sample run of "Spider" adventure game

Quintus Prolog Release 2.5.1 (Sun-3, SunOS 4.1)
Copyright (C) 1990, Quintus Computer Systems, Inc.  All rights reserved.
1310 Villa Street, Mountain View, California  (415) 965-7700

| ?- consult(spider).
[consulting /sun/lbs1/dave/teach/files/spider.pl...]
[spider.pl consulted 1.550 sec 9,256 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.

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.
Go into that dark cave without a light?  Are you crazy?
You can't go that way.
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
| ?- 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
| ?- kill(spider).
[Warning: the procedure kill/1 is undefined (warning 2100)]
[However, kill/0 is defined]
   (1) 0 Call: kill(spider) ? 
   (1) 0 Fail: kill(spider) ? l

no
| ?- kill.
This isn't working.  The spider leg is about as tough
as a telephone pole, too.
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.
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
| ?-