Introduction
Learn about the basic rules of Rock Paper Scissors.
We'll cover the following
Rock Paper Scissors is a simple hand gesture game. When played by two people, each player simultaneously makes a hand gesture representing one of three options:
- Rock (a closed fist)
- Paper (an open hand)
- Scissors (a fist with the index and middle fingers extended)
The winner of the game is determined by a set of rules that dictate which gesture beats which other gesture. The game is often used to settle disputes or make decisions in a fun and lighthearted way.
Rules
The rules of Rock Paper Scissors are simple and easy to understand. These are listed below:
-
Rock beats scissors: If one player makes a fist to represent rock, and the other player extends their index and middle fingers to represent scissors, the player with the rock wins.
-
Scissors beats paper: If one player extends their index and middle fingers to represent scissors, and the other player makes a flat hand gesture to represent paper, the player with the scissors wins.
-
Paper beats rock: If one player makes a flat hand gesture to represent paper, and the other player makes a fist to represent rock, the player with the paper wins.
If both players make the same gesture, it’s a tie, and the game is usually played again until there is a winner. Depending on the players’ preferences, the game can be played as a single round or as a best-of-three or best-of-five series.
Implemented game
In this course, we’ll make a CLI version of the Rock Paper Scissors game using the JavaScript programming language. We’ll first take a deep dive into the game requirements and then walk you through the process step by step to develop the final product!
The widget below shows the final outlook of the game. Interact with it to better understand our goal:
Note: The “reset” button will not be part of our project. It is here so that you can test the output multiple times.