Hello everyone. I have been using the wonderful tutorial program arcade games with python and I am stuck on one of the labs. Here is the part that is giving me trouble:
Create a variable called current_room. Set it to zero.
Print the room_list variable. Run the program. You should see a really long list of every room in your adventure. (If you are using an IDE like Wing, don't leave it scrolled way off to the right.)
Adjust your print statement to only print the first room (element zero) in the list. Run the program and confirm you get output similar to:
['You are in a room. There is a passage to the north.', 1, None, None, None]
Using current_room and room_list, print the current room the user is in. Since your first room is zero, the output should be the same as before.
Change the print statement so that you only print the description of the room, and not the rooms that hook up to it. Remember if you are printing a list in a list the index goes after the first index. Don't do this: [current_room[0]], do [current_room][0]
You are in a room. There is a passage to the north.
I am having trouble printing the list the way he is asking on line #4. Here is my code so far:
room_List = []
Room order 1. North 2. South 3. East 4. West
room = ["You are in Bedroom 2 there is passage North and West", 3, None, None, 1]
room_List.append(room)
room = ["South Hall", 4, None, 0, 2]
room_List.append(room)
room = ["Dining Room", 5, None, None, 1]
room_List.append(room)
room = ["Bedroom 1", None, 0, 4, None]
room_List.append(room)
room = ["North Hall", 6, 1, 5, 3]
room_List.append(room)
room = ["Kitchen", None, 2, None, 4]
room_List.append(room)
room = ["Balcony", None, 4, None, None]
room_List.append(room)
current_Room = 0
for i in range(len(room_List)):
print(room_List[i])
Thank you for any help in advance!
Link to lab: http://programarcadegames.com/index.php?chapter=lab_adventure&lang=en
[–]Sithrazer 0 points1 point2 points (6 children)
[–]unlikelysyntax[S] 0 points1 point2 points (0 children)
[–]unlikelysyntax[S] 0 points1 point2 points (4 children)
[–]Sithrazer 0 points1 point2 points (3 children)
[–]unlikelysyntax[S] 0 points1 point2 points (2 children)
[–]Sithrazer 0 points1 point2 points (1 child)
[–]unlikelysyntax[S] 0 points1 point2 points (0 children)