Skip to content

Commit 008a53f

Browse files
committed
Refactor original strategy to return 0 or 1
1 parent 4d84857 commit 008a53f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/axelrod_fortran/player.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def original_strategy(
5151
args = (
5252
c_int(their_last_move), c_int(move_number), c_int(my_score),
5353
c_int(their_score), c_float(noise), c_int(my_last_move))
54-
action = self.original_function(*[byref(arg) for arg in args])
55-
return actions[action]
54+
return self.original_function(*[byref(arg) for arg in args])
5655

5756
def strategy(self, opponent, noise=0):
5857
if not self.history:
@@ -64,9 +63,10 @@ def strategy(self, opponent, noise=0):
6463
scores = compute_final_score(zip(self.history, opponent.history))
6564
my_last_move = original_actions[self.history[-1]]
6665
move_number = len(self.history) + 1
67-
return self.original_strategy(
66+
original_action = self.original_strategy(
6867
their_last_move, move_number, scores[0], scores[1], noise,
6968
my_last_move)
69+
return actions[original_action]
7070

7171
def reset(self):
7272
super().reset()

0 commit comments

Comments
 (0)