Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from room import Room
- # his command looks for a file in the same folder called room.py,
- #and looks inside that file for a class called Room (upper-case R)
- #– this is the class we just wrote.
- #It then makes that class available for use
- #inside the main.py file.
- kitchen = Room("Kitchen") #We can now instantiate createa Room object
- #like this.
- kitchen.set_description(" A dank and dirty room buzzing with flies.")
- # kitchen.get_description()
- #kitchen.describe()
- house = Room(" House")
- house.set_description(" a beautiful house")
- #house.describe()
- dining_hall = Room(" Dining Hall")
- dining_hall.set_description (" We eat confortable, long table , many chairs")
- #dining_hall.describe()
- ballroom = Room(" Ballroom")
- ballroom.set_description (" Nice big room for dancing")
- #ballroom.describe()
- kitchen.link_room(dining_hall, "south")
- house.link_room(kitchen, "east")
- house.link_room(ballroom, "south")
- dining_hall.link_room(kitchen,"north")
- dining_hall.link_room(ballroom,"west")
- ballroom.link_room(dining_hall,"east")
- ballroom.link_room(house,"north")
- #dining_hall.get_details()
- #house.get_details()
- """
- current_room = kitchen
- while True:
- print("\n")
- current_room.get_details()
- command = input(" > ")
- current_room = current_room.move(command)
- """
- from item import Item
- knife = Item("Knife")
- knife.set_description("Long and sharp")
- knife.describe()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement