3rd task assigned by TheOdinProject.
-
First is to code the classic game of rock-paper-scissors with the output showing in the console panel. An input is received with the
promptfunction from the player and is checked against a random number that corresponds to rock, paper or scissors. The winner of the round and current score is printed in the console panel. A game consists of 5 rounds and after 5 rounds, the winner of the game is also once again printed in the console panel. This rendition of the game can be found in themainbranch. -
With JavaScript,
buttonstake on the role of thepromptinput function and the output is now printed on the webpage itself instead of the console panel. A combat log now prints the player's selection, computer's selection and the result of the round. A scoreboard updates and keeps track of the scores after each round. Similarly, after 5 rounds, the user is notfied whether they have won or lost the game. This rendition of the game can be found in therps-uibranch.
The live preview of the 2nd rendition can be viewed here.
- Add rock, paper and scissor images to replaece mundane
buttons - Add animations to victory screen
- Implement a method which does not require a combat log
The full task can be viewed here.