Question: I wrote a code which asks the user to input either east, west, south, or north. Each direction should output a different sentence. Im not
I wrote a code which asks the user to input either east, west, south, or north. Each direction should output a different sentence. Im not sure what im doing wrong but it only outputs the same sentence no matter what direction you enter. Like the image below. My code is attached please make modifications so it works properly. USE PYTHON PLEASE!!!!

MY CODE:
room_list = []
room = [0, 1, 2, 3, 4]
# COURTYARD
room[0] = "You have entered the castle courtyard. Birds bounce upon the stony courtyard and fly off into the distant blue sky"
# Directions: North, East, South, or West
# NORTH (Throne Room aka Room 1) room[1] = 1
# EAST room[2] = None
# SOUTH room[3] = None
# WEST room[4] = None
room_list.append(room)
# Golden throne room with silver chalice spewing crimson blood: room = [0, 1, 2, 3, 4]
room[0] = "You have entered what appears to be a throne room, caressed in gold in every direction. Rubies, sapphires, and emeralds sparkle on the throne, while a silver chalice keeps overflowing crimson blood from some unknown source on a pedestal."
# Directions: North, East, South, or West
# NORTH (Armory aka Room 4) room[1] = 4
# EAST (Dining Room aka Room 3) room[2] = 3
# SOUTH (Courtyard aka Room 0) room[3] = 0
# WEST (Electric Billiard Room aka Room 2) room[4] = 2
room_list.append(room)
# Create an electric billiard room with lightning spokes at each corner of the table
room = [0, 1, 2, 3, 4]
room[0] = "You have entered an electric billiard room. Lightning spokes are at each end of the table and spark blue waves of electricity every five seconds. The room is dimly lit but covered in a blue aura."
# NORTH room[1] = None
# EAST (Throne Room aka Room 1) room[2] = 1
# SOUTH room[3] = None
# WEST room[4] = None
room_list.append(room)
# Green Dining Hall:
room = [0, 1, 2, 3, 4]
room[0] = "You have opened a huge brown door and walked down marble steps into what appears to be a dining hall. Green garland and banners circle the ceiling with matching Bat crests. The plates and dining ware are impeccable sterile, and shinking due to the white light cascading through the ceiling's circular window."
# NORTH room[1] = None
# EAST room[2] = None
# SOUTH room[3] = None
# WEST (Throne Room aka Room 1) room[4] = 1
room_list.append(room)
# Armory:
room = [0, 1, 2, 3, 4]
room[0] = "You have opened a silver door to enter the armory. Each delicately crafted piece of armor gives off a green glow, and claymores the size of the tallest man on earth hang on racks on the wall. Each sword glows red upon your approach to the center of the room and trembles violently, clashing against the wall."
# NORTH room[1] = None
# EAST room[2] = None
# SOUTH (Throne Room aka Room 1) room[3] = 1
# WEST room[4] = None
room_list.append(room)
current_room = 0
next_room = 0
# Create a boolean variable for a loop condition: done = False
while done == False: print("**************************") print("Welcome to Vampire Castle!") print("**************************") print(" ", room_list[next_room][0]) direction = str(input("What direction would you like to go? Options To Type: North, East, South, West. Press 'q' to quit.")) direction = direction.lower() # User Selects North: if direction == "north": if room_list[current_room][1] is None:#check if the element is none before assigning to next room. print("You can't go that way.") continue next_room = room_list[current_room][1] # User Selects East: elif direction == "east": if room_list[current_room][2] is None:#check if the element is none before assigning to next room. print("You can't go that way.") continue next_room = room_list[current_room][2] # User Selects South: elif direction == "south": if room_list[current_room][3] is None:#check if the element is none before assigning to next room. print("You can't go that way.") continue next_room = room_list[current_room][3] # User Selects West: elif direction == "west": if room_list[current_room][4] is None:#check if the element is none before assigning to next room. print("You can't go that way.") continue next_room = room_list[current_room][4] # User Decides To Quit: elif direction == "q": done = True
current_room = next_room
"Python 3.4.3 Shell File Edit Shell Debug Options Window Help Welcome to Vampire Castle! You have entered the castle courtyard Birds bounce upon the stony courtyard and fly off into the distant blue sky What direction would you 1ike to go? Options To Type: North, East, South, West. Press 'qto quit. west Welcome to Vampire Castle! You have entered the castle courtyard Birds bounce upon the stony courtyard and fly off into the distant blue sky What direction would you 1ike to go? Options To Type: North, East, South, West. Press 'qto quit. south Welcome to Vampire Castle! You have entered the castle courtyard Birds bounce upon the stony courtyard and fly off into the distant blue sky What direction would you 1ike to go? Options To Type: North, East, South, West. Press 'qto quit. North Welcome to Vampire Castle! You have entered the castle courtyard Birds bounce upon the stony courtyard and fly off into the distant blue sky What direction would you 1ike to go? Options To Type: North, East, South, West
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
