A simple console-based JavaScript implementation of the "Rock - Paper - Scissors" game.
- Check out the App Library
Rock - Paper - Scissors is a simple two player game, where you and your opponent (the computer) simultaneously choose one of the following three options: "rock", "paper" or "scissors". The rules are as follows:
- Rock beats scissors (the scissors get broken by the rock)
- Scissors beat paper (the paper gets cut by the scissors)
- Paper beats rock (the rock gets covered by the paper) The winner is the player whose choice beats the choice of his opponent. If both players choose the same option, the game ends with a draw.
rock
orr
paper
orp
scissors
ors
The computer chooses a random option, then the winner is revealed.
YOU | COMPUTER | OUTCOME |
---|---|---|
rock | rock | Draw |
rock | paper | You lose |
rock | scissors | You win |
paper | rock | You win |
paper | paper | Draw |
paper | scissors | You lose |
scissors | rock | You lose |
scissors | paper | You win |
scissors | scissors | Draw |