An open API service indexing awesome lists of open source software.

https://github.com/mirokrastanov/rockpaperscissors

🪨📄✂️ Web-based JavaScript implementation of the popular "Rock Paper Scissors" game. (Small Project))
https://github.com/mirokrastanov/rockpaperscissors

game javascript web

Last synced: over 1 year ago
JSON representation

🪨📄✂️ Web-based JavaScript implementation of the popular "Rock Paper Scissors" game. (Small Project))

Awesome Lists containing this project

README

          

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

game-image

## Live Demo
[run-button](https://app-library-13e36.web.app/apps/rps)
### The Demo is now part of my app library
- Check out the [App Library](https://app-library-13e36.web.app/)

## 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](https://app-library-13e36.web.app/apps/rps)

- [Original Source Code](https://github.com/mirokrastanov/RockPaperScissors)
- [React Implementation Code for the App Library](https://github.com/mirokrastanov/app-library/tree/main/client/src/apps/rps)