You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The check_for_secret_passageway() function is correctly returning the linked rooms, if present.
The dictionary is updating to show the secret passageway room is 0 spaces (use secret passageway), but when trying to move there, it takes the original number of steps, rather than 0, so may say you have not rolled enough.
The console is printing:
========================================
The rooms are the following distances:
1- Kitchen: 0 space(s) (stay in room)
2- Ball Room: 3 space(s)
3- Conservatory: 6 space(s)
4- Billiard Room: 8 space(s)
5- Dining Room: 3 space(s)
6- Library: 10 space(s)
7- Lounge: 6 space(s)
8- Main Hall: 9 space(s)
9- Study: 0 space(s) (Use secret passageway)
Which room would you like to move towards?: 9
{'Kitchen': '0', 'Ball Room': '3', 'Conservatory': '6', 'Billiard Room': '8', 'Dining Room': '3',
'Library': '10', 'Lounge': '6', 'Main Hall': '9', 'Study': '12'}
You have not rolled enough to reach the Study.
1. Move 3 spaces towards the Study
2. Stay at current location
The suspected offending code is:
room_distances = gameboard.room_distances()
print(f"Not updated from gameboard.room_distances: {room_distances}")
# move towards the desired room
new_player_location = player.move_player(player_location, desired_room, current_room,
turn_die_roll, room_distances, ROOM_LOCATIONS)
gameboard.update_player_location([new_player_location])
The text was updated successfully, but these errors were encountered:
This bug was caused by the gameboard.choose_room() function returning the name of the desired room, but not updating the room_distances dictionary.
This bug was fixed by returning both the desired room and the updated room_distances dictionary from gameboard.choose_room() function, and using tuple unpacking to access the variables.
The updated dictionary was then passed as an argument into player.move_player(), rather than using the original dictionary from before it checked for secret passageways.
The check_for_secret_passageway() function is correctly returning the linked rooms, if present.
The dictionary is updating to show the secret passageway room is 0 spaces (use secret passageway), but when trying to move there, it takes the original number of steps, rather than 0, so may say you have not rolled enough.
The console is printing:
The suspected offending code is:
The text was updated successfully, but these errors were encountered: