summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2004-01-06 02:37:31 +0000
committerMario Lang <mlang@delysid.org>2004-01-06 02:37:31 +0000
commit4da6564176fc664a5116b1cfb3e879b524757d40 (patch)
treee36af56c65389dd8076c39371d093f7a53b81832
parentd088e576b04c3560b21e328a9e54beaf5599a197 (diff)
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.
-rw-r--r--chess-var.el6
1 files 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."