summaryrefslogtreecommitdiff
path: root/chess-ply.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2004-03-01 16:24:45 +0000
committerMario Lang <mlang@delysid.org>2004-03-01 16:24:45 +0000
commiteafa7a587d12f503a16d6538f88029afe011051c (patch)
tree1cd746cf43f6a3169f27a07f56e73f9817d5a908 /chess-ply.el
parent20bfd26c43049f346ef0f72ca4a8cb4387d7f782 (diff)
(chess-legal-plies): Add :candidates keyword to avoid calls to chess-search-position if the caller already knows the piece indices
Diffstat (limited to 'chess-ply.el')
-rw-r--r--chess-ply.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/chess-ply.el b/chess-ply.el
index 3ba0a40..826151d 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -305,6 +305,7 @@ KEYWORDS allowed are:
:file <number 0 to 7> [can only be used if :piece is present]
:index <coordinate index>
:target <specific target index>
+ :candidates <list of inddices>
These will constrain the plies generated to those matching the above
criteria.
@@ -344,6 +345,8 @@ position object passed in."
;; more focused search
(dolist (candidate
(cond
+ ((cadr (memq :candidates keywords))
+ (cadr (memq :candidates keywords)))
((setq pos (cadr (memq :index keywords)))
(list pos))
((setq file (cadr (memq :file keywords)))