Skip to content

Commit d014e39

Browse files
committed
Fix typos and make empty list check more pythonic
1 parent e9abbe8 commit d014e39

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

axelrod/strategies/titfortat.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def strategy(opponent: Player) -> Action:
9696
class DynamicTwoTitsForTat(Player):
9797
"""
9898
A player starts by cooperating and then punishes its opponent's
99-
defectiions by opponent with a dynamic bias based off of the
100-
opponents ratio of cooperations to total moves (so their current
101-
probability of cooperating towards cooporating regardless of the
102-
move (aka: forgiveness)).
99+
defections with defections, but with a dynamic bias towards cooperating
100+
based off of the opponent's ratio of cooperations to total moves
101+
(so their current probability of cooperating regardless of the
102+
opponent's move (aka: forgiveness)).
103103
104104
Names:
105105
@@ -120,7 +120,7 @@ class DynamicTwoTitsForTat(Player):
120120
@staticmethod
121121
def strategy(opponent):
122122
# First move
123-
if len(opponent.history) == 0:
123+
if not opponent.history:
124124
# Make sure we cooporate first turn
125125
return C
126126
if D in opponent.history[-2:]:

0 commit comments

Comments
 (0)