Nov 23, 2016 08:04 AM
(This post was last modified: Nov 23, 2016 08:16 AM by S M I T H Y.)
So im working on some agents to play the Axelrods python game, the agent i currently have is below, what i would like to know is how would i implement a new strategy into this agent? A strategy such as one that always defects? The agent always needs to return either a 'C' for cooperate or D for defect.
[/quote]
Code
class PlayerFlipper:
def move(self, history):
mine, theirs = history
if len(mine) % 2 == 0:
return 'C'
else:
return 'D'
