21 Adventure

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

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

As Larry Roberts envisioned As deployed in 1969:


it in his notebooks:
The ARPANET in 1971
The ARPANET in 1971
PDP-10 PDP-10 PDP-11 PDP-10 TX-2

SRI UTAH ILLINOIS MIT LINCOLN CASE

PDP-15 IMP IMP IMP IMP IMP IMP PDP-10

GE-645 360/67

UCSB STANFORD SDC 360/67


CARNEGIE

360/75 IMP IMP IMP DDP 516 IMP PDP-10

PDP-10

PDP-10
UCLA RAND BBN HARVARD BURROUGHS

SIGMA 7 IMP IMP IMP IMP IMP

360/91 IBM 3800 DDP 516 PDP-10 PDP-1 PDP-10 86500


360/65

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:

A small circle of friends at BBN had gotten


hooked on Dungeons and Dragons, an elaborate
fantasy role-playing game in which one player
invents a setting and populates it with monsters
and puzzles, and the other players then make their
way through that setting. The game exists only in
the minds of the players.
Dave Walden got his introduction to the game one
night when Eric Roberts, a student from a class he
was teaching at Harvard, took him to a D&D
session. Walden immediately rounded up a group
of friends from the ARPANET team for continued
sessions. Roberts created the Mirkwood Tales. . . .
One of the regulars was Will Crowther . . .
The BBN ARPANET Team

Dave Willie
Walden Crowther
Willie Crowther’s Adventure Game
Adventure

Welcome to ADVENTURE!! Would you like instructions?

YES

Somewhere nearby is Colossal Cave, where others have found fortunes in


treasure and gold, though it is rumored that some who enter are never
seen again. Magic is said to work in the cave. I will be your eyes
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.)
Good Luck!
- - - -
You are standing at the end of a road before a small brick building.
Around you is a forest. A small stream flows out of the building and
down a gully to the south. The road runs up a small hill to the west.

GO INSIDE

You are inside a building, a well house for a large spring.


There are some keys on the ground here. . . .
Willie Crowther’s Adventure Game
Adventure

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

The main program, which


gets the program started.

AdvGame AdvRoom AdvObject

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.

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.
> WEST
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
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.
>
The SmallRooms.txt Data File
OutsideBuilding
Outside building
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.
-----
WEST: EndOfRoad
UP: EndOfRoad
NORTH: InsideBuilding
IN: InsideBuilding
SOUTH: Valley
DOWN: Valley

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.

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.
> WEST
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
Outside building.
>
Milestone #3
• Implement the QUIT, HELP, and LOOK commands.
• Once you finish this milestone, the player can end the game,
see the help text, and redisplay the room’s long description.

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.
> WEST
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
Outside building.
> LOOK
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.
> QUIT
Milestone #4
• Implement the AdvObject class.
• Implement the methods in the AdvRoom class that make it
possible to keep track of the objects in a room.
• In the AdvGame class, write the code to put each object in its
initial room (ignore the room name "PLAYER" for now).
• Change the code to display a room so that it lists the objects.
• This milestone allows you to see (but not yet take) objects.

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.

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.
> TAKE KEYS
Taken.
> TAKE GOLD
I don't see that here.
> INVENTORY
You are carrying:
a bottle of water
a set of keys
> DROP WATER
Dropped.
> DROP KEYS
Dropped.
> INVENTORY
You are empty-handed.
>
Milestone #6
• Implement synonym processing so that the player can use
abbreviated forms of the direction verbs and alternative
names for the objects.

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.

You are in a 20-foot depression floored with bare dirt.


Set into the dirt is a strong steel grate mounted in
concrete. A dry streambed leads into the depression from
the north.
> INVENTORY
You are carrying:
a bottle of water
a set of keys
> DOWN
You are in a small chamber beneath a 3x3 steel grate to
the surface. A low crawl over cobbles leads inward to
the west.
There is a brightly shining brass lamp here.
>
The SmallRooms.txt Data File
OutsideGrate
InsideBuilding
Outsidebuilding
Inside grate
in a 25-foot
You are inside depression
a building, floored
a well withabare
house for dirt.
large spring.
Set into the dirt is a strong steel grate mounted in
-----
concrete.
SOUTH: A dry streambed leads into the depression from
OutsideBuilding
the north.
OUT: OutsideBuilding
-----
NORTH: SlitInRock
Valley
UP: SlitInRock
Valley beside a stream
DOWN: BeneathGrate/KEYS
You are in a valley in the forest beside a stream tumbling
DOWN: a
along MissingKeys
rocky bed. The stream is flowing to the south.
-----
MissingKeys
NORTH: OutsideBuilding
Above locked grate
UP: OutsideBuilding
The grate is locked and you don't have any keys.
SOUTH: SlitInRock
-----
DOWN: SlitInRock
FORCED: OutsideGrate
SlitInRock
BeneathGrate
Slit in rock
Beneath grate
At
You are in a all
your feet the
small water of
chamber the stream
beneath a 3x3 splashes into
steel grate toa
two-inch slit in
the surface. thecrawl
A low rock.over
To the south,
cobbles theinward
leads streambed
to is
bare rock.
the west.
-----
NORTH: Valley
UP: OutsideGrate
UP:
OUT:Valley
OutsideGrate
SOUTH: OutsideGrate
IN: CobbleCrawl
DOWN:
WEST: OutsideGrate
CobbleCrawl
Milestone #8
• Implement forced motion, in which the player is forced to
move from a room even before reading a command. Forced
motion is indicated by the verb FORCED.
• It is important to ensure that your implementation of forced
motion allows those passages to be locked. This combination
of features is used to implement the shimmering curtain.

You are in a 20-foot depression floored with bare dirt.


Set into the dirt is a strong steel grate mounted in
concrete. A dry streambed leads into the depression from
the north.
> INVENTORY
You are carrying:
a bottle of water
> DOWN
The grate is locked and you don't have any keys.
Outside grate.
>
The End

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy