Rock, Paper, Scissors Game Explanation
Explanation:
The code is in Python.
Import the random to be able to generate number number
Generate a random number between 0 and 2 (inclusive) using the randint() method and set it to the computer variable.
Ask the user to enter a number and set it to the user variable.
Check the value of the computer variable:
- If it is 0, check the value of the user variable. If the user is 0, it is a draw. If the user is 1, the user wins. If the user is 2, the computer wins.
- If it is 1, check the value of the user variable. If the user is 0, the computer wins. If the user is 1, it is a draw. If the user is 2, the user wins.
- If it is 2, check the value of the user variable. If the user is 0, the user wins. If the user is 1, the computer wins. If the user is 2, it is a draw.