The coding issues are due to syntax errors, such as mismatched quotes and improper function definition inside a print statement. Correcting these will ensure that room directions like "West, South, North, East" are matched with user input to navigate the adventure game.
From the code snippets and the issues you've described, it looks there are a few errors in your Python syntax. You're experiencing issues because of mismatched quotes and misplaced function definitions within the print statement. Furthermore, the room directions like "West, South, North, East" are supposed to match the user input to execute correctly in your adventure game.
Here's a corrected version of your 'show_instructions' and 'player_status' functions with proper syntax:
def show_instructions():
print("\\You have fallen into an unknown cave alongside with the Princess!\\"
"You must escape by venturing and finding resources to help you fight through path!\\"
"There will be 9 rooms, each will either have helpful items, or traps!\\"
"Keep away from the Sorcerers' Bedroom, find the Green Crystal, ladder & Magic Sword to help out!\\"
"You must escape by going back to the dungeon with ladder, without you or Princess dying!\\"
"Move commands: go South, go North, go East, go West.\\")
def player_status(inventory, current_room, rooms):
print('\\Inventory:', inventory)
print('You are currently in the {}'.format(current_room))
if 'item' in rooms[current_room]:
print('You found a', rooms[current_room]['item'])
print("- --- -")
In the corrected code, pay attention to the consistent use of escape sequences for new lines (\\) and the proper closing of print statements, as well as the correct function definition outside of the 'show_instructions' function. Also, ensuring that the 'if' condition correctly accesses the dictionary will resolve the issue regarding commands not being recognized.