21 Adventure
21 Adventure
21 Adventure
Jerry Cain
CS 106AX
November 8, 2019
slides constructed by Eric Roberts
The Origins of the Internet
• The Internet that has become so much a part of today’s world
got its start as the ARPANET in the late 1960s.
• The contract to build the ARPANET was awarded to Bolt
Beranek and Newman Inc. (BBN), a small, Cambridge-based
research and development firm founded by MIT engineers.
• On October 29th, 1969, then UCLA student Charley Kline
sent the first message on ARPANET. The message was
supposed to be the word "login", but only "io" was
transmitted before the system crashed.
• A prototype implementation of the ARPANET connecting
four nodes came online in early December 1969.
• The initial design for the ARPANET allowed for a maximum
of 127 connected computers. Larger networks were possible
only after the TCP/IP protocols were adopted in the 1980s.
Early Designs for the ARPANET
GE-645 360/67
PDP-10
PDP-10
UCLA RAND BBN HARVARD BURROUGHS
ILLIAC IV
The ARPANET Directory
Life among the Wizards
The history of the Internet has been told in several books. One
tells the following story:
Dave Willie
Walden Crowther
Willie Crowther’s Adventure Game
Adventure
YES
GO INSIDE
You are in
Welcome to the Hall of the
ADVENTURE!! Mountain
Would King,
you like with passages off in most
instructions?
directions, some of which appear to be newly constructed.
YES
A huge green fierce snake bars the way!
Somewhere nearby is Colossal Cave, where others have found fortunes in
RELEASE BIRD
treasure and gold, though it is rumored that some who enter are never
The
seenlittle
again.bird attacks
Magic theto
is said green
worksnake,
in theand cave.in an
I astounding flurry
will be your eyes
drives the snake away.
and hands. Direct me with natural English commands; I don't under-
stand all of the English language, but I do a pretty good job.
(Should you get stuck, type "HELP" or "?" for some general hints.)
. . . some time later . . .
Good Luck!
- - - -
You
You are
are standing at the
in a secret endwhich
canyon of a roadexitsbefore
to theanorthsmalland
brick building.
east.
Around
A huge you isfierce
green a forest. A small
dragon bars the stream
way!flows out of the building and
The
downdragon isto
a gully sprawled out on
the south. The a persian
road runs rug!!
up a small hill to the west.
GO INSIDE
RELEASE BIRD
You are inside a building, a well house for a large spring.
The little bird attacks the green dragon, and in an astounding flurry
There are some
gets burnt to akeys on the
cinder. ground
The asheshere.
blow . . .
away.
A Brief History of Adventure
• Eric Roberts begins the Mirkwood Tales in early 1975.
• Will Crowther creates Adventure later that year.
• Will moves to Xerox/PARC in 1976.
• Stanford graduate student Don Woods releases an expanded
version of Adventure in early 1977.
• Dave Lebling and others from MIT release the first version of
Zork in 1977. That game later becomes the foundation of the
computer game company Infocom.
• Adventure is ported to a wide variety of platforms by 1980.
• Eric Roberts creates an expanded version in 1984 and uses it
as the basis for his first Adventure Contest at Wellesley.
Classes in the Adventure Game
Adventure
Contains the code and data Maintains the data structure Maintains the data structure
necessary to play the game. for each room in the cave. for each object that can be
carried by the player.
Milestone #1
• Adapt the code from the Teaching Machine application so
that it uses the class and method names for Adventure.
• Once you finish this milestone, you should be able to wander
around the surface geography of the game.
EndOfRoad
End of road
You are at the end of a road at the top of a small hill.
You can see a small building in the valley to the east.
-----
EAST: OutsideBuilding
DOWN: OutsideBuilding
The SmallRooms.txt Data File
InsideBuilding
OutsideBuilding
Inside
Outsidebuilding
building
You
You are
are inside
standing
a building,
at the enda of
well
a road
housebefore
for a alarge
smallspring.
brick
-----
building. A small stream flows out of the building and
SOUTH:
down a OutsideBuilding
gully to the south. A road runs up a small hill
OUT:
to theOutsideBuilding
west.
-----
Valley
WEST: EndOfRoad
Valley
UP: EndOfRoad
beside a stream
You
NORTH:
are InsideBuilding
in a valley in the forest beside a stream tumbling
along
IN: InsideBuilding
a rocky bed. The stream is flowing to the south.
-----
SOUTH: Valley
NORTH:
DOWN: Valley
OutsideBuilding
UP: OutsideBuilding
SOUTH:
EndOfRoad
SlitInRock
DOWN:
End ofSlitInRock
road
You are at the end of a road at the top of a small hill.
SlitInRock
You can see a small building in the valley to the east.
Slit
-----in rock
At
EAST:
yourOutsideBuilding
feet all the water of the stream splashes into a
two-inch
DOWN: OutsideBuilding
slit in the rock. To the south, the streambed is
bare rock.
-----
NORTH: Valley
UP: Valley
SOUTH: OutsideGrate
DOWN: OutsideGrate
Milestone #2
• Implement the setVisited and hasBeenVisited methods
in AdvRoom.
• Check this flag in the code that describes a room.
• Once you finish this milestone, the program should use the
short descriptions when you enter a previously visited room.
Outside building.
> IN
You are inside a building, a well house for a large spring.
The exit door is to the south. There is another room to
the north, but the door is barred by a shimmering curtain.
There is a set of keys here.
>
The SmallObjects.txt Data File
KEYS
a set of keys
InsideBuilding
LAMP
a brightly shining brass lamp
BeneathGrate
ROD
a black rod with a rusty star
DebrisRoom
WATER
a bottle of water
PLAYER
Milestone #5
• Implement the TAKE, DROP, and INVENTORY commands and
any code you need to remember what the player is carrying.
Welcome to Adventure
You are standing at the end of a road before a small brick
building. A small stream flows out of the building and
down a gully to the south. A road runs up a small hill
to the west.
> I
You are carrying:
a bottle of water
> DROP BOTTLE
Dropped.
> W
You are at the end of a road at the top of a small hill.
You can see a small building in the valley to the east.
> D
Outside building.
There is a bottle of water here.
>
The SmallSynonyms.txt Data File
Q=QUIT
L=LOOK
I=INVENTORY
N=NORTH
S=SOUTH
E=EAST
W=WEST
U=UP
D=DOWN
Milestone #7
• Implement locked passages, which are passages that require
a particular object to use, as illustrated on the next slide.
• Making this change requires moving the getNextRoom code
from AdvRoom to AdvGame so that it can see the objects.