> http://www.nytimes.com/interactive/science/rock-paper-scissors.html > > > the computer outsmarts you the same way that street fighter 2's AI outsmarts you when > zangief's low roundhouse takes priority over your low jab when the program starts > controller reading.
It just scans for the what a human player (or the current player, depending) does most often based on the four prior rounds of both players. There are relatively few possible combinations (under 150k, including the first rounds, I think). Each is a variable with the most common next play as the value. Well, three values, tracking the number of responses for each.
That's a ridiculously simple program to write using a single array.
I stopped at 10/12/14, after i looked at what it was "thinking."
|