From 604df1aa41591d193d0ad1f7f7034a3bcb42b17f Mon Sep 17 00:00:00 2001 From: SampurnaSen Date: Wed, 5 Oct 2022 18:46:23 +1100 Subject: [PATCH] Rock, Paper, Scissors game --- Projects/1-Beginner/Rock-Paper-Scissors.md | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Projects/1-Beginner/Rock-Paper-Scissors.md diff --git a/Projects/1-Beginner/Rock-Paper-Scissors.md b/Projects/1-Beginner/Rock-Paper-Scissors.md new file mode 100644 index 00000000..9beb0a48 --- /dev/null +++ b/Projects/1-Beginner/Rock-Paper-Scissors.md @@ -0,0 +1,29 @@ +# Rock, Paper and Scissors + +**Tier:** 1-Beginner + +Rock, paper, scissors is a game we all have played IRL. Now let's use our fundamental knowledge of programming to create it in code.Loops, if conditions and a simple algorithm will be used. +Your task is to let the user input one option between rock, paper and scissors. The other opponent's option will be randomly generated from the code. Only two outcomes are possible - a draw or a win for one player and a loss for the other player. +Use an algorithm that would find the winner and restart the game. + +## User Stories + +- [ ] User can enter a value from [rock, paper, scissor] +- [ ] User can see the randomly genrated opponents option +- [ ] User can view the outcome of the game + +## Bonus features + +- [ ] Change the game to be for 10 moves. Who wins will get 1 point everytime. At the end of the 10 moves, declare the winner and restart the game. + +## Useful links and resources + +- [If, else condition](https://www.w3schools.com/js/js_if_else.asp) +- [Math functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math) +- [Loops and iterations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration) +- [Loop exercise](https://contactmentor.com/js-loop-exercises-solutions/) + +## Example projects + +- [Game reference in JS](https://www.geeksforgeeks.org/rock-paper-and-scissor-game-using-javascript/) +- [Game reference in Python](https://thehelloworldprogram.com/python/python-game-rock-paper-scissors/)