Skip to content

Commit

Permalink
improved basic player by maximizing both moving up and current_level …
Browse files Browse the repository at this point in the history
…(now 70% win rate against firsty first)
  • Loading branch information
daniPclos committed Apr 13, 2024
1 parent f4155ef commit 96d61c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions santorinai/player_examples/basic_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def play_move(self, board):
available_pawns = []
best_spot = None
best_spot_pawn_idx = None
best_spot_level = 0
best_spot_level = -2

# Iterate over available pawns
for idx, pawn in enumerate(board.get_player_pawns(self.player_number)):
Expand All @@ -93,7 +93,7 @@ def play_move(self, board):

# Check if possible to go up
pos_level = board.board[pos[0]][pos[1]]
if pos_level <= current_level + 1 and pos_level > best_spot_level:
if pos_level <= current_level + 1 and pos_level > best_spot_level + current_level:
# We can go up
best_spot = pos
best_spot_pawn_idx = idx
Expand Down

0 comments on commit 96d61c8

Please sign in to comment.