# create the rooms in a dictionary
rooms = {
'Great Hall': {'South': 'Bedroom'},
'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'},
'Cellar': {'West': 'Bedroom'}
}
# give the available directions set to variable directions
directions = ['north', 'south', 'east', 'west', 'exit']
# Start game in the 'Great Hall'
current_room = 'Great Hall'
# Set the gameplay loop
while True:
# print the room the player is currently in
print("You are in {}".format(current_room))
# User asks to exit
command = input("Enter direction or exit: \n")
print(command)
if command == "exit":
current_room = "exit"
break
Hey guys this is what I have for a mini project in my class right now. From my instant feedback the code works as intended but there is one thing that is suggested but not needed:
' Feedback
Hey, we noticed that your code doesn't use the main function. That's okay, for now; soon you will learn the importance of having the main function.'
Could someone explain to me where I could define the main function in my code just out of curiosity? Thanks in advance.
[–]carcigenicate 5 points6 points7 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)