The Snake Water & Gun Game
This is a game where the user plays against the computer by choosing between Snake, Water or Gun. After Each Round it displays who won the round whether the computer or user.
Created on 31st January 2023
•
The Snake Water & Gun Game
This is a game where the user plays against the computer by choosing between Snake, Water or Gun. After Each Round it displays who won the round whether the computer or user.
The problem The Snake Water & Gun Game solves
##How it works
The game uses JavaScript to determine the winner of each round. The computer's choice is randomly generated using the built-in Math.random() function. The game compares the player's choice with the computer's choice to determine the winner, and updates the scores accordingly.
Rules
- Snake beats Gun
- Water beats Snake
- Gun beats Water
Conclusion
This game is a fun and simple way to test your luck and strategy against the computer. It can also be used as a tool to teach basic programming concepts such as conditionals and event listeners for the newbies.
Challenges I ran into
As this game requires many if-else conditions I missed out on some conditions which I discovered while testing I referred to some documentations and also learned about different types of events in addEventListener other than click event.
Tracks Applied (1)
Replit
Replit
Technologies used