From 4e0af8d85ed9c1c8feb025abafe2dba87604ccb5 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 19 Apr 2002 07:53:38 +0000 Subject: Fixes and other work. --- chess-game.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'chess-game.el') 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)))) -- cgit v1.2.3