Rock-paper-scissors: Difference between revisions

Content added Content deleted
(J)
(wordliness and task)
Line 1: Line 1:
{{draft task}}In this task, the goal is to implement the classic children's game [[wp:Rock-paper-scissors|Rock-paper-scissors]], as well as a simple predictive AI player.
{{draft task}}In this task, the goal is to implement the classic children's game [[wp:Rock-paper-scissors|Rock-paper-scissors]], as well as a simple predictive AI player.


Rock Paper Scissors has two players. Each player chooses one of rock, paper or scissors, without knowing the other player's choice. The winner is decided by a set of rules:
Rock Paper Scissors is a two player game. Each player chooses one of rock, paper or scissors, without knowing the other player's choice. The winner is decided by a set of rules:


* Rock beats scissors
* Rock beats scissors
Line 9: Line 9:
If both players choose the same thing, there is no winner for that round.
If both players choose the same thing, there is no winner for that round.


== Task ==
For this task's AI player, keep track of the player's choice frequency, and use that choice frequency to make a [[Probabilistic choice|weighted random choice]] to beat the player's likely choice.

For this task, the computer will be one of the players. The opponent will select Rock, Paper or Scissors and the computer will keep a record of the choice frequency, and use that information to make a [[Probabilistic choice|weighted random choice]] to in an attempt to defeat the player.


=={{header|Ada}}==
=={{header|Ada}}==