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 choicemakes madeits choice first
H := Human_Choice; -- now asask the player for his/her choice
Cnt(H) := Cnt(H) + 1; -- update the counts for the AI
if C < H then
Anonymous user