File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
from axelrod import Actions , Player , init_args
2
+ from axelrod .random_ import random_choice
2
3
3
4
C , D = Actions .C , Actions .D
4
5
@@ -16,7 +17,7 @@ class Desperate(Player):
16
17
17
18
def strategy (self , opponent ):
18
19
if not opponent .history :
19
- return D
20
+ return random_choice ()
20
21
if self .history [- 1 ] == D and opponent .history [- 1 ] == D :
21
22
return C
22
23
return D
@@ -35,7 +36,7 @@ class Hopeless(Player):
35
36
36
37
def strategy (self , opponent ):
37
38
if not opponent .history :
38
- return C
39
+ return random_choice ()
39
40
if self .history [- 1 ] == C and opponent .history [- 1 ] == C :
40
41
return D
41
42
return C
@@ -54,7 +55,7 @@ class Willing(Player):
54
55
55
56
def strategy (self , opponent ):
56
57
if not opponent .history :
57
- return C
58
+ return random_choice ()
58
59
if self .history [- 1 ] == D and opponent .history [- 1 ] == D :
59
60
return D
60
61
return C
You can’t perform that action at this time.
0 commit comments