diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-19 07:53:38 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-19 07:53:38 +0000 |
| commit | 4e0af8d85ed9c1c8feb025abafe2dba87604ccb5 (patch) | |
| tree | 5f1c83d3829350475e41abb3d3d5647f3dc276e6 /chess-game.el | |
| parent | 5e7133d9e7a77ea970f5ba1cbf60fe5a2d26cf17 (diff) | |
Fixes and other work.
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)))) |
