Fix Bug in Rock Paper Scissors Game for Scissor Selection #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Overview
This pull request addresses a bug reported in Issue #1 regarding the Rock Paper Scissors game implemented in Python. The issue arises when the player selects 's' for scissors, resulting in an error during execution.
Bug Description
When a user chooses 's' for scissors, the game encounters an error that prevents it from functioning as intended. The specific error traceback provided indicates that there is an issue with how the player's input is being evaluated in the main game loop.
Error Traceback:
Proposed Solution
Upon analysis, the root cause of the bug appears to be the incorrect usage of parentheses in the conditional check where user input is evaluated. The line of code is currently attempting to execute
move()
as a function, which is incorrect.The proposed fix is to modify the condition in line 29 by removing the parentheses. This will enable the correct evaluation of the user's input without attempting to call it as a function.
Code Changes
Testing
Conclusion
This pull request corrects the bug that prevents the Rock Paper Scissors game from functioning properly when choosing scissors. I believe this fix will enhance the overall user experience and ensure that learners can successfully interact with the Python code.
Thank you for the opportunity to contribute to this project! I look forward to feedback and any further enhancements you may suggest.