Skip to content

Commit

Permalink
Add last move to the action space
Browse files Browse the repository at this point in the history
  • Loading branch information
bovard committed Dec 10, 2024
1 parent eda7fcd commit bbe6429
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kaggle_environments/envs/chess/chess.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
"type": "number",
"default": 10
},
"lastMove": {
"description": "Previous move to get to this position.",
"type": "string",
"default": ""
},
"remainingOverageTime": 10
},
"action": {
Expand Down
4 changes: 4 additions & 0 deletions kaggle_environments/envs/chess/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ def interpreter(state, env):
state[0].observation.opponentRemainingOverageTime = state[1].observation.remainingOverageTime
state[1].observation.opponentRemainingOverageTime = state[0].observation.remainingOverageTime

# Update last move
state[0].observation.lastMove = active.action
state[1].observation.lastMove = active.action

pawn_or_capture_move_count = int(
fen.split(" ")[4]) # fen keeps track of this
# Check for game end conditions
Expand Down

0 comments on commit bbe6429

Please sign in to comment.