Skip to content

optimize version#80

Open
Anshuman7080 wants to merge 1 commit into
shrishail356:mainfrom
Anshuman7080:main
Open

optimize version#80
Anshuman7080 wants to merge 1 commit into
shrishail356:mainfrom
Anshuman7080:main

Conversation

@Anshuman7080
Copy link
Copy Markdown

Use of Objects for Choices and Messages: This organizes the code better, making it easier to manage and understand.
Simplified Functions: Removed unnecessary variables and streamlined the logic for showing messages and updating scores.
Reduced Redundancy: Combined the logic for win, lose, and draw into a single function (showMessage) to handle messages and visibility changes.
Cleaner Random Choice Logic: Simplified the random selection of the computer's choice using Math.floor() directly.
More Readable Function Names: Used descriptive function names to improve code readability.
This optimized version should work the same as your original code while being cleaner and easier to maintain!

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