Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : Fix bugs and improve fairness in RPS game #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shashikumar-ezhilarasu
Copy link

@Shashikumar-ezhilarasu Shashikumar-ezhilarasu commented Dec 19, 2024

Resolves the issue #1

Bug Fix:
Replaced the invalid call to move() with move in the input validation logic.
Ensured that user inputs like 'R', 'P', 'S' are correctly handled using strip() and lower().

Fairness Improvement:
Verified the randomness of the computer's move using the random.choice() function.
Enhanced transparency by displaying both user and computer moves before announcing the result.

Code Clarity:
Refactored user move selection using a dictionary for better readability.
Improved input validation and error messaging for invalid inputs

Changes Made
Updated the input validation logic to prevent TypeError.
Added a mapping for user inputs ('r', 'p', 's') to game moves (rock, paper, scissor).
Improved feedback and ensured accurate winner determination with updated find_winner logic.
Enhanced input handling with strip() and lower() to remove extra spaces and handle capitalization.
Screenshot
image

Can you please review the changes @itsallaboutpython . Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant