Prisoners dilemma is a classic intro game theory problem. The police put each prisoner into an interrogation room. The police tell each player they have two options: snitch or stay. If both prisoners stay, then they both get half a year in prison. If one prisoner snitches, the snitch gets zero years, and the "stayer" gets one year. If they both snitch, they both get one full year. The priosners can not trade information, so they must both choose independently.
Now suppose the Prisoners play this keep playing this game. Each time they get the result of the previous game, thus they are able to update their strategy. The player who "serves" the fewest years after many games wins.
By implementing the Prisoner
class,
and by following the comments and the Pacifist
and the Evil
models,
make your own Prisoners.
If you do,
make a pull request to add them.
To test out your Prisoner
use the test.py
file.
Also, if you have any other PRs please make them.
If I get enough, I'll starting running challenges to see who the winner is.