diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-03-11 20:57:21 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-03-11 20:57:21 +0000 |
| commit | 871e9bb270b35c621265fc56ec582bdd39900e2a (patch) | |
| tree | 0f031b50dba5beb8a49e697f2488831a32f69655 /chess-ply.el | |
| parent | 442c62fd96d5cb79ab34faf1d8108d86372e96c3 (diff) | |
changes
Diffstat (limited to 'chess-ply.el')
| -rw-r--r-- | chess-ply.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chess-ply.el b/chess-ply.el index 172c154..65c11b7 100644 --- a/chess-ply.el +++ b/chess-ply.el @@ -45,6 +45,7 @@ ;;; Code: (require 'chess-pos) +(require 'chess-standard) (defgroup chess-ply nil "Routines for manipulating chess plies." @@ -69,19 +70,20 @@ (defsubst chess-ply-create (position &rest changes) (cons position changes)) -(defun chess-legal-plies (position color) - "Return a list of all legal plies in POSITION for COLOR." +(defun chess-legal-plies (position &optional search-func) + "Return a list of all legal plies in POSITION." (let (plies) (dotimes (rank 8) (dotimes (file 8) (let* ((to (chess-rf-to-index rank file)) (piece (chess-pos-piece position to))) (when (or (eq piece ? ) - (if color + (if (chess-pos-side-to-move position) (> piece ?a) (< piece ?a))) - (dolist (candidate (funcall (car chess-modules) - nil nil 'search position to t)) + (dolist (candidate (funcall (or search-func + chess-standard-search) + position to t)) (push (chess-ply-create position candidate to) plies)))))) plies)) |
