Its color tells you the result of the round:
|Result||You scored||Opponent scored|
How to play
|Cooperate||3 (3)||0 (5)|
|Defect||5 (0)||1 (1)|
You are awarded the points in bold, and the other player gets the points in parentheses.
Your goal is to get as many points as you can. The other player's score doesn't affect you, except that the other player will strategize to get as many points as possible too.
Please see our Overview for more information.
self) has an
actorfield. Make your move by calling one of these functions on the actor:
actor.act(action)where action is
resultfor the round, with these fields:
myAction- action you picked
myPayoff- points you got
otherPlayerAction- action opponent picked
otherPlayerPayoff- points opponent got
See full API for more info.
Our present Python example is Tit For Tat, a short routine which cooperates on the first move, and thereafter does what the opponent did on the previous move.
If Tit For Tat source code is not already visible in the editor, click here to load it.