My name is Emily and I am a software developer. Earlier this year I finished studying Python Backend Development full-time with the Digital Career Institute (DCI) and Full Stack Software Development part-time with Code Institute.
cluedo's Introduction
cluedo's People
Forkers
code-institute-submissionscluedo's Issues
Printing "You chose to stay in the hallway" instead of stay in current room
When testing, a bug was found when a player selects a room that is further away than the number of moves available. If the player selects a far away room, they are prompted with "do you want to move x spaces towards that room, or stay in the current location?" If they are in the room, and choose to stay, the console should print "You chose to stay in the x room", but it is actually printing "You chose to stay in the hallway"
Number not recognised as valid input
While attempting to add a number validation to user inputs that require a number as an answer, this error occured, even when valid numbers (in this case 1 and 2) were entered:
The suspected offending code is:
def number_input_validation(user_input):
"""
Takes a number as input and prompts the user to choose an option.
If the user input is a number between 1 and the input, returns the number.
"""
options = ""
for num in range(1, user_input+1):
if num != user_input:
options += str(num) + " "
elif num == user_input:
options.strip()
options += "or " + str(user_input)
while True:
user_ans = input(f"Your answer ({options}): ")
if user_ans == num in range(1, user_input+1):
return user_ans
else:
print(f"Sorry, that is not a valid input, please enter a number between 1 and {user_input}."
Cards are shown by last AI player with relevant card instead of first
When questioning the AI characters about their cards, once a card has been found, the checking loop should stop and a card from the first player that has a relevant card should be shown. Instead, the loop is continuing and the card shown is the last card from the last character investigated.
In the above example, the for loop should be returning the first card of the three being investigated (Miss Scarlett, Dagger, Kitchen) that is encountered. In this case, it should return the Dagger from Col. Mustard.
Secret passageway bug
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])
Heroku terminal bug
A bug was identified in the way that the Heroku platform displays the terminal. Despite using the "clear" function, it is possible to scroll up to previous outputs. This has become an issue since changing the style of the 'investigation card' so that it no longer completely fits within the Heroku terminal window, requiring the user to scroll back up to see it all.
Cards in the "murder envelope" always the same
'Colonel Mustard not in list' bug
KeyError when selecting a room
Game crashing if the murder cards are investigated
Sometimes end in wrong room bug
This bug happens when a user selects a room which has a distance higher than the die roll for the turn but is exactly the correct number for another room. If that room is on the way to the desired room, the user will end up in that room.
For example here, the user has rolled a 3 and wants to move from the Kitchen to the Conservatory (6 spaces away). The Ball room (1,4) is exactly 3 spaces away and lies between the Kitchen (1,1) and the Conservatory (1,7). Therefore, the user ends up in the Ball room.
Always printing that user is in the hallway
When the user is supposed to be in a room, the code is always returning "hallway". In this example, space [1,1] should be the kitchen but it is printing "You are currently in the hallway"
The offending code is as follows:
def which_room(self, current_space):
"""Takes the current space of a player and returns which room they are in.
If player is not in a room, returns hallway."""
for room, space in self.rooms.items():
if current_space == space:
return room
return "the hallway"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.