diff options
Diffstat (limited to 'chess-game.el')
| -rw-r--r-- | chess-game.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chess-game.el b/chess-game.el index b1b1ccf..99131db 100644 --- a/chess-game.el +++ b/chess-game.el @@ -163,8 +163,8 @@ This conveys the status of the game at the given index." (1+ (/ index 2))) 1))) -(defsubst chess-game-side-to-move (game) - (chess-pos-side-to-move (chess-game-pos game))) +(defsubst chess-game-side-to-move (game &optional index) + (= (mod (or index (chess-game-index game)) 2) 0)) (defun chess-game-ply (game &optional index) "Return the position related to GAME's INDEX position." @@ -193,6 +193,13 @@ This conveys the status of the game at the given index." (chess-game-run-hooks game 'post-undo count)) +(defun chess-game-strip-annotations (game) + "Strip all annotations from the given GAME." + (dotimes (i (chess-game-index game)) + (let ((position (chess-game-pos game i))) + (chess-pos-set-annotations position nil)))) + + (defsubst chess-game-over-p (game) "Return the position related to GAME's INDEX position." (let ((last-ply (car (last game 2)))) |
