Anonymous user
Rock-paper-scissors: Difference between revisions
m
no edit summary
(Added Ada version) |
mNo edit summary |
||
Line 10:
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.
=={{header|Ada}}==
Line 94 ⟶ 95:
-- play the game
loop
C := Computer_Choice; -- the computer
H := Human_Choice; -- now
Cnt(H) := Cnt(H) + 1; -- update the counts for the AI
if C < H then
|