Skip to content

Commit

Permalink
Added player visuals on replays
Browse files Browse the repository at this point in the history
  • Loading branch information
bovard committed Nov 8, 2024
1 parent 02060c8 commit 2b13dd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
15 changes: 15 additions & 0 deletions kaggle_environments/envs/chess/chess.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions kaggle_environments/envs/chess/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def square_str_to_int(square_str):
game_one_complete = False
game_start_position = math.floor(random.random() * len(OPENINGS))


def interpreter(state, env):
global seen_positions
global game_one_complete
Expand Down Expand Up @@ -227,11 +228,9 @@ def interpreter(state, env):
fen.split(" ")[4]) # fen keeps track of this
# Check for game end conditions
if pawn_or_capture_move_count == 100 or is_insufficient_material(
game.board):
active.status = terminal_state
inactive.status = terminal_state
game_one_complete = True
elif seen_positions[board_str] >= 3 or game.status == Game.STALEMATE:
game.board) or seen_positions[board_str] >= 3 or game.status == Game.STALEMATE:
active.reward += .5
inactive.reward += .5
active.status = terminal_state
inactive.status = terminal_state
game_one_complete = True
Expand Down

0 comments on commit 2b13dd5

Please sign in to comment.