Skip to content

Commit 43b5862

Browse files
rnjdmarcharper
authored andcommitted
Changed first play to random on mutual2
1 parent 53d38a4 commit 43b5862

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

axelrod/strategies/mutual.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from axelrod import Actions, Player, init_args
2+
from axelrod.random_ import random_choice
23

34
C, D = Actions.C, Actions.D
45

@@ -16,7 +17,7 @@ class Desperate(Player):
1617

1718
def strategy(self, opponent):
1819
if not opponent.history:
19-
return D
20+
return random_choice()
2021
if self.history[-1] == D and opponent.history[-1] == D:
2122
return C
2223
return D
@@ -35,7 +36,7 @@ class Hopeless(Player):
3536

3637
def strategy(self, opponent):
3738
if not opponent.history:
38-
return C
39+
return random_choice()
3940
if self.history[-1] == C and opponent.history[-1] == C:
4041
return D
4142
return C
@@ -54,7 +55,7 @@ class Willing(Player):
5455

5556
def strategy(self, opponent):
5657
if not opponent.history:
57-
return C
58+
return random_choice()
5859
if self.history[-1] == D and opponent.history[-1] == D:
5960
return D
6061
return C

0 commit comments

Comments
 (0)