Welcome back to another exciting Monday of Problem of the Day! Registration through Github is now open! There are currently no features for registered users except for the fact that all your comments will be associated with your account. As comment features come online you'll be able to make use of them on older posts with your account.
Today's goal is to build out the AI for our favorite childhood game, Rock Paper Scissors. The AI for this program will keep track of the player's previous choices and then make its move based off that. If a player chooses rock 3 times in a row then the AI should weight paper heavier when selecting its move. To prevent cheating, the AI must make its decision before the player inputs their move.
For a bonus write the data to file so that your AI data can reflect over time. A simple text file with 3 numbers indicating how many times each choice has been chosen will work or you can choose to do something more complex.
A quick recap for those who haven't played in awhile:
- Rock beats Scissors
- Scissors beats Paper
- Paper beats Rock
Comments:
duddles - 10 years, 8 months ago
Here's a pretty basic attempt in python:
reply permalink
Jt - 10 years, 8 months ago
C#, attempt to determine what you're most likely to choose as the next answer and counter that.
reply permalink
Hueho - 10 years, 8 months ago
In Ruby. I'm too lazy to deal with files, so I just dump and load a hash with weight using YAML serializing.
reply permalink
Byron - 10 years, 7 months ago
Made using Python. :)
reply permalink