Skip to content

Latest commit

History

History
46 lines (34 loc) 路 2.11 KB

README.md

File metadata and controls

46 lines (34 loc) 路 2.11 KB

RockPaperScissors

A simple console-based JavaScript implementation of the "Rock - Paper - Scissors" game.

game-image

Live Demo

run-button

The Demo is now part of my app library

Description

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.

Input & Output

  • rock or r
  • paper or p
  • scissors or s

The computer chooses a random option, then the winner is revealed.

Game Logic | Possible Scenarios

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

Live Demo

run-button