forked from bloominstituteoftechnology/Intro-Python-II
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# Write a class to hold player information, e.g. what room they are in | ||
# currently. | ||
|
||
class Person: | ||
def __init__(self, name, room, items): | ||
self.name = name | ||
self.room = room | ||
self.item = [] | ||
|
||
def __str__(self): | ||
return f'{self.name} is in {self.room}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
# Implement a class to hold room information. This should have name and | ||
# description attributes. | ||
# description attributes. | ||
class Room: | ||
def def __init__(self, name, description, items=[]): | ||
self.name = name | ||
self.description = description | ||
|
||
self.n_to = None | ||
self.s_to = None | ||
self.e_to = None | ||
self.w_to = None | ||
|
||
def __str__(self): | ||
return self.name, self.descr | ||
|
||
|