Skip to content

Commit 5309b4c

Browse files
gaffney2010drvinceknight
authored andcommitted
Fix RevisedDowning
1 parent 22e836a commit 5309b4c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

axelrod/strategies/revised_downing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def strategy(self, opponent: Player) -> Action:
5252

5353
# Update various counts
5454
if round_number > 2:
55-
if self.history[-1] == D:
55+
if self.history[-2] == D:
5656
if opponent.history[-1] == C:
5757
self.nice2 += 1
5858
self.total_D += 1

axelrod/tests/strategies/test_revised_downing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def test_strategy(self):
3030
self.versus_test(opponent, expected_actions=actions)
3131

3232
opponent = axl.MockPlayer(actions=[D, D, C])
33-
actions = [(C, D), (C, D), (D, C), (D, D)]
33+
actions = [(C, D), (C, D), (D, C), (C, D)]
3434
self.versus_test(opponent, expected_actions=actions)
3535

3636
opponent = axl.MockPlayer(actions=[C, C, D, D, C, C])
37-
actions = [(C, C), (C, C), (C, D), (C, D), (D, C), (D, C), (D, C)]
37+
actions = [(C, C), (C, C), (C, D), (C, D), (D, C), (C, C), (D, C)]
3838
self.versus_test(opponent, expected_actions=actions)
3939

4040
opponent = axl.MockPlayer(actions=[C, C, C, C, D, D])

0 commit comments

Comments
 (0)