8000 flake · pythonminna/Intro-Python@27cb7f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 27cb7f5

Browse files
author
Beej Jorgensen
committed
flake
1 parent a451080 commit 27cb7f5

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/adv/adv.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
# Declare all the rooms
66

77
room = {
8-
'outside': Room("Outside Cave Entrance", "North of you, the cave mount beckons"),
8+
'outside': Room("Outside Cave Entrance",
9+
"North of you, the cave mount beckons"),
910

10-
'foyer': Room("Foyer", "Dim light filters in from the south. Dusty passages run north and east."),
11+
'foyer': Room("Foyer", """Dim light filters in from the south. Dusty
12+
passages run north and east."""),
1113

1214
'overlook': Room("Grand Overlook", """A steep cliff appears before you, falling
1315
into the darkness. Ahead to the north, a light flickers in
1416
the distance, but there is no way across the chasm."""),
1517

16-
'narrow': Room("Narrow Passage", """The narrow passage bends here from west to north. The smell
17-
of gold permeates the air."""),
18+
'narrow': Room("Narrow Passage", """The narrow passage bends here from west
19+
to north. The smell of gold permeates the air."""),
1820

1921
'treasure': Room("Treasure Chamber", """You've found the long-lost treasure
2022
chamber! Sadly, it has already been completely emptied by
@@ -38,7 +40,8 @@ def tryDirection(d, curRoom):
3840
"""
3941
Try to move a direction, or print an error if the player can't go that way.
4042
41-
Returns the room the player has moved to (or the same room if the player didn't move).
43+
Returns the room the player has moved to (or the same room if the player
44+
didn't move).
4245
"""
4346
attrib = d + '_to'
4447

@@ -91,4 +94,3 @@ def tryDirection(d, curRoom):
9194
player.curRoom = tryDirection(s, player.curRoom)
9295
else:
9396
print("Unknown command {}".format(s))
94-

src/adv/player.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Write a class to hold player information, e.g. what room they are in currently
1+
# Write a class to hold player information, e.g. what room they are in
2+
# currently.
3+
24

35
class Player:
46
"""Holds information about a player"""
57
def __init__(self, startRoom):
6-
self.curRoom = startRoom
8+
self.curRoom = startRoom

src/adv/room.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Implement a class to hold room information. This should have name and
22
# description attributes.
33

4+
45
class Room:
56
def __init__(self, name, description):
67
self.name = name
7-
self.description = description
8+
self.description = description

0 commit comments

Comments
 (0)
0