Skip to content

optimized code #381

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

optimized code #381

wants to merge 2 commits into from

Conversation

Anshuman7080
Copy link

Functionality Encapsulation: Created get_computer_choice() to handle the computer's choice logic, making it clearer and more modular.
Winner Determination: Simplified determine_winner() to handle all win/lose conditions with fewer checks.
Input Handling: Added a space before %c in scanf to ignore any leading whitespace or newline characters.
Variable Names: Made variable names more descriptive, such as player_choice and computer_choice, for better readability.
This should keep the functionality intact while improving clarity and efficiency!

@Anshuman7080 Anshuman7080 reopened this Oct 12, 2024
@Anshuman7080
Copy link
Author

this is a valid pull request

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

Successfully merging this pull request may close these issues.

1 participant