Giter Club home page Giter Club logo

cluedo's Introduction

Hi there ๐Ÿ‘‹

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.

๐Ÿ’ป Tech Stack:

Languages

Python JavaScript HTML5 CSS3

Databases

PostgreSQL

Frameworks & Accessories

Django DjangoREST React Postman Flask

Version Control/Hosting

Git GitHub Heroku

๐ŸŒฑ Iโ€™m currently learning ...

FastAPI Docker AWS

๐Ÿ’ป I'm currently using ...

Ubuntu Visual Studio Jupyter Notebook Notion Slack

๐Ÿ“Š GitHub Stats:

Github Stats

Top Langs

cluedo's People

Contributors

dragon-fire-fly avatar

Watchers

 avatar

cluedo'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"

hallway_bug
hallway_bug_2

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:
num_not_recognised

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.

choosing_last_card_bug_annotated

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.

secret_passageway_bug

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.

terminal_scrolling_bug

Cards in the "murder envelope" always the same

The shuffling function does not appear to be correctly shuffling the cards within each of the card decks (suspects, weapons, rooms) and therefore when the 'pop' function is used, the same three cards are always being chosen for the "murder envelope" (Miss Scarlett, Spanner, dining room)
always_same_cards_bug

'Colonel Mustard not in list' bug

When selecting a character, if Colonel Mustard is selected, it returns an error that " 'Colonel Mustard' is not in list"
choosing_col_mustard
colonel_mustard_not_in_list

It is currently unclear which piece of code is causing this issue.

KeyError when selecting a room

Something in the code was changed and now when choosing a room, the program is throwing a "KeyError". This is the case for all numbers input and on both the local and deployed versions.

key_error

Game crashing if the murder cards are investigated

If the user asks the other players about the correct cards from the "murder envelope", the game crashes as it has not been programmed to deal with the function not returning a person and a card to display to the user

not_in_anyones_hand

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.
end_in_wrong_room_2

end_in_ball_room
gameboard_with_coords

Always printing that user is in the hallway

wrong_room_bug

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.