diff --git a/kaggle_environments/envs/chess/chess.json b/kaggle_environments/envs/chess/chess.json index 4803c10e..54d16812 100644 --- a/kaggle_environments/envs/chess/chess.json +++ b/kaggle_environments/envs/chess/chess.json @@ -42,6 +42,11 @@ "type": "number", "default": 10 }, + "lastMove": { + "description": "Previous move to get to this position.", + "type": "string", + "default": "" + }, "remainingOverageTime": 10 }, "action": { diff --git a/kaggle_environments/envs/chess/chess.py b/kaggle_environments/envs/chess/chess.py index a45b9ab4..04a51ca4 100644 --- a/kaggle_environments/envs/chess/chess.py +++ b/kaggle_environments/envs/chess/chess.py @@ -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