Rock Paper Scissors
Create a rock paper scissors game.
We'll cover the following
Coding project
Let’s try another coding project. This time, we’ll try to create an interactive version of the classic game Rock Paper Scissors, where we play against the computer. This will give us a chance to use what we’ve learned in this chapter to determine who wins the game.
To get started, let’s ask the player what their choice is.
const player = prompt('Choose rock, paper or scissors').toLowerCase().trim();
This uses a prompt box to ask the user to enter “rock”, “paper”, or “scissors”.
Get hands-on with 1400+ tech skills courses.