Skip to content

Commit 6f28c9f

Browse files
committed
Merge branch 'master' of github.com:drvinceknight/Axelrod
2 parents f4be6bc + c9f3320 commit 6f28c9f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

axelrod/strategies/alternator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ def strategy(self, opponent):
88
"""
99
Alternate 'C' and 'D'
1010
"""
11+
if len(self.history) == 0:
12+
return 'C'
1113
if self.history[-1] == 'C':
1214
return 'D'
1315
return 'C'

0 commit comments

Comments
 (0)