@@ -58,16 +58,17 @@ def test_strategy(self):
58
58
attrs = {'grudged' : False , 'mem_length' : 10 , 'grudge_memory' : 0 }
59
59
self .versus_test (opponent , expected_actions = actions , attrs = attrs )
60
60
61
- # grudge_memory goes to ten, resets and climbs back to five.
62
- opponent = axl .Defector ()
63
- actions = [(C , D )] + [(D , D )] * 15
64
- attrs = {'grudged' : True , 'mem_length' : 10 , 'grudge_memory' : 5 }
65
- self .versus_test (opponent , expected_actions = actions , attrs = attrs )
61
+ for i in range (1 , 15 ):
62
+ opponent = axl .Defector ()
63
+ actions = [(C , D )] + [(D , D )] * i
64
+ memory = i if i <= 10 else i - 10
65
+ attrs = {'grudged' : True , 'mem_length' : 10 , 'grudge_memory' : memory }
66
+ self .versus_test (opponent , expected_actions = actions , attrs = attrs )
66
67
67
68
opponent_actions = [C ] * 2 + [D ] + [C ] * 10
68
69
opponent = axl .MockPlayer (actions = opponent_actions )
69
- actions = ([(C , C )] * 2 + [(C , D )] + [(D , C )] * 10 ) * 3
70
- attrs = {'grudged' : True , 'mem_length' : 10 , 'grudge_memory' : 10 }
70
+ actions = ([(C , C )] * 2 + [(C , D )] + [(D , C )] * 10 ) * 3 + [( C , C )]
71
+ attrs = {'grudged' : False , 'mem_length' : 10 , 'grudge_memory' : 0 }
71
72
self .versus_test (opponent , expected_actions = actions , attrs = attrs )
72
73
73
74
def test_reset_method (self ):
0 commit comments