Programming-Practice
Programming-Practice copied to clipboard
optimized code
trafficstars
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!
this is a valid pull request