Beispiel #1
0
def test_room_paths():
    center = Room("Center", "Test room in the center.")
    north = Room("North", "Test room in the north.")
    south = Room("South", "Test room in the south.")
    center.add_paths({'north': north, 'south': south})
    assert_equal(center.go('north'), north)
    assert_equal(center.go('south'), south)
Beispiel #2
0
def test_room_paths():
    center = Room("Center", "Test room in the center.")
    north = Room("North", "Test room in the north.")
    south = Room("South", "Test room in the south.")

    center.add_paths({'north': north, 'south': south})
    assert_equal(center.go('north'), north)
    assert_equal(center.go('south'), south)
Beispiel #3
0
def test_room_paths():
    center = Room("Center", "Test room in the center.")
    north = Room("North", "Test room in the north.")
    south = Room("South", "Test room in the south.")

    center.add_paths({"north": north, "south": south})
    assert_equal(center.go("north"), north)
    assert_equal(center.go("south"), south)
def test_room_paths():
    center = Room("Center", "Test room in the center.")
    north = Room("North", "Test room in the north.")
    south = Room("South", "Test room in the south.")

    center.add_paths({"north": north, "south": south})
    assert_equal(center.go("north"), north)
    assert_equal(center.go("south"), south)
Beispiel #5
0
def test_map():
    start = Room("Start", "You can go west and down a whole.")
    west = Room("Trees", "There are trees here, you can go east.")
    down = Room9"Dungeon","It's dark down here,you can go up.")

    start.add_paths({'west':west,'down':down})
    west.add_paths({'east';start})
    down.add_paths({'up':start})

    assert_equal(start.go('west'),west)
    assert_equal(start.go('west').go('east'),start)
    assert_equal(start.go('down').go('up'),start)
Beispiel #6
0
def test_map():
    start = Room("Start", "You can go west and down a hole.")
    west = Room("Trees", "There are trees here, you can go east")
    down = Room("Dungeon", "It`s dark down here, you can go up.")

    start. add_paths({'west' : west, 'down' : down})
    west.add_paths({'east' : start})
    down.add_paths({'up' : start})

    assert_equal(start. go('west'), west)
    assert_equal(start. go('west'). go('east'), start)
    assert_equal(start. go('down'). go('up'), start)
Beispiel #7
0
def test_map():
    start = Room("Start", "There is a path to the west.")
    west = Room("Trees", "There are trees here, the only path is to the east.")
    down = Room("Dungeon", "It's dark down here, you can go up.")

    start.add_paths({'west': west, 'down': down})
    west.add_paths({'east': start})
    down.add_paths({'up': start})

    assert_equal(start.go('west'), west)
    assert_equal(start.go('west').go('east'), start)
    assert_equal(start.go('down').go('up'), start)
Beispiel #8
0
def test_map():
    start = Room("Start", "You can go west and down a hole.")
    west = Room("Trees", "There are trees here, you can go east.")
    down = Room("Dungeon", "It's dark down here, you can go up.")

    start.add_paths({"west": west, "down": down})
    west.add_paths({"east": start})
    down.add_paths({"up": start})

    assert_equal(start.go("west"), west)
    assert_equal(start.go("west").go("east"), start)
    assert_equal(start.go("down").go("up"), start)
Beispiel #9
0
def test_map(): 
	start=Room("start", "you can go west and down a hole")
	west= Room("trees", "there are treest here ")
	down= Room("dungeon", "it is dark down here, you can go up")

	start.add_paths({'west': west, 'down': down})
	west.add_paths({"east": start})
	down.add_paths({'up': start})

	assert_equalstart.go('west'), west)
	assert_equal(start.go('west').go('east'), start)
	assert_equal(start.go('down').go('up'), start)
def test_map():
    start = Room("Start", "You can go west and down a hole.")
    west = Room("Trees", "There are trees here, you can go east.")
    down = Room("Dungeon", "It's dark down here, you can up")

    start.add_paths({"west": west, "down": down})
    west.add_paths({"east": start})
    down.add_paths({"up": start})

    assert_equal(start.go("west"), west)
    assert_equal(start.go("west").go("east"), start)
    assert_equal(start.go("down").go("up"), start)
def test_map():
    start = Room("Start", "You can go west and down a hole.")
    west = Room("Trees", "There are trees here, you can go east.")
    down = Room("Dungeon", "It's dark down here, you can go up.")

    start.add_paths({'west': west, 'down': down})
    west.add_paths({'east': start})
    down.add_paths({'up': start})

    print(id(west))
    print(id(start.go('west')))
    assert start.go('west') is west
    assert start.go('west').go('east') == start
    assert start.go('down').go('up') == start
Beispiel #12
0
a football comes crashing through your window. Before you can even react, the
device emits a series of quick beeps, that get closer together before violently
releasing a deathly black gas that instantaneously knocks you out cold.""",
"Press Enter to Continue...")

hallway = Room("in your apartment hallway.",
"""\"You've made the right choice\" The stranger lady says. \"The name's Leandra
Serafim, but we have to get you out of here quick.\" She makes a dash for the
nearest exit. You try to follow, but the closer you get to the outside world, the
more anxious you feel and the harder it is to breathe. Fear creeps up on you and
chokes you from the inside. Eventually you fall to the ground as everything goes
black...""", "Press Enter to Continue...")

defilers_base = Room("in a dark room.", """You are at the defilers base. Gotta figure out what to do now.""",
"Press ctrl-d to Quit.")

rebel_base = Room("at the rebel base.", """You are in the rebel base. Gotta figure out what to do now.""",
"Press ctrl-d to Quit.")

intro.add_paths({'': character})
character.add_paths({'':apartment})
apartment.add_paths({'yes': stocks, 'no': skip_stocks})
skip_stocks.add_paths({'': email})
stocks.add_paths({'': email})
email.add_paths({'north': foyer})
foyer.add_paths({'yes': granted, 'no': denied})
granted.add_paths({'':choices})
denied.add_paths({'':choices})
choices.add_paths({'stay': apartment2, 'go': hallway})
apartment2.add_paths({'':defilers_base})
hallway.add_paths({'': rebel_base})