Codecademy Practice

Rock, Paper, Scissors - Part 1

Challenge: Rock paper scissors (part 1)

Create a simple program to play rock paper scissors. The user should be able to select one of the three options, rock, paper or scissors, and then wait for the computer to play its turn. Once the computer has made its choice, the result will be printed to the screen.

These are the rules:

If the human wins, print: You win!

If the human loses, print: You lose!

If both coincide, print: It’s a draw!

To practice: if/else conditionals, functions, scope, arrays, adding and removing classes through JavaScript.

Example:

Choose a gesture!

- rock
- paper
- scissors
(user selects paper)

Computer gesture:

- rock

You win!
Video showing the basic logic of the game.

Step by step instructions:

HTML

CSS

JS

GIT

DEBUGGING