import random
class Flipper():
''' Flipper will alternate defections and cooperations, selecting the first
move randomly.
'''
def step(self, history, round):
if round == 0:
action = random.randint(0, 1)
else:
action = history[self.order][round - 1]^1
return action