Skip to content

Commit

Permalink
Added player visuals on replays (#303)
Browse files Browse the repository at this point in the history
* Added player visuals on replays

* bump version
  • Loading branch information
bovard authored Nov 8, 2024
1 parent 02060c8 commit 0795b41
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kaggle_environments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .main import http_request
from . import errors

__version__ = "1.16.0"
__version__ = "1.16.1"

__all__ = ["Agent", "environments", "errors", "evaluate", "http_request",
"make", "register", "utils", "__version__",
Expand Down
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 0795b41

Please sign in to comment.