From 4da6564176fc664a5116b1cfb3e879b524757d40 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Tue, 6 Jan 2004 02:37:31 +0000 Subject: add &optional index to chess-var-side-to-move (sync with chess-game-side-to-move) and document it, mirroring chess-game-side-to-move docstring. --- chess-var.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chess-var.el b/chess-var.el index 859d355..0ef94d4 100644 --- a/chess-var.el +++ b/chess-var.el @@ -30,9 +30,11 @@ (assert var) (1+ (/ (chess-var-index var) 2))) -(defsubst chess-var-side-to-move (var) +(defsubst chess-var-side-to-move (var &optional index) + "Return the color whose move it is in VAR at INDEX (or at the last position +of the variation if INDEX is nil)." (assert var) - (chess-pos-side-to-move (chess-var-pos var))) + (chess-pos-side-to-move (chess-var-pos var index))) (defun chess-var-ply (var &optional index) "Return the position related to VAR's INDEX position." -- cgit v1.2.3