#Challenge #159 A solution to r/dailyprogrammer's challenge #159 in JavaScript.
Check it out here.
See the full rules on the relevant dailyprogrammer posts:
The challenge is to create a basic implementation of Rock Paper Scissors Lizard Spock. The initial stage is a basic implementation of the game, and subsequent updates increased the difficulty.
Create a basic game that takes a user input for a move, and pits the move against a simple AI. The computer AI will pseudo-randomly pick a move. The moves will be compared and the outcome displayed. Statistics for each players wins, ties and games played should be displayed on exiting (I display these in a sidebar).
In addition to the original game, implement a basic AI and a basic game loop:
- The user can continue playing until they decide to quit.
- Upon quitting the user is presented with a record of games played, player wins, ai wins, ties and associated percentages. (I display these in the sidebar).
- The AI remembers the players previous moves, and picks it's next move based on the player's top picks and picking a counter. In the case of a tie, the computer will select randomly amongst counter moves, excluding moves it is attempting to counter.
- Enable the user to select which AI to play against (random, learning)