From 871e9bb270b35c621265fc56ec582bdd39900e2a Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 11 Mar 2002 20:57:21 +0000 Subject: changes --- chess-ply.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'chess-ply.el') 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)) -- cgit v1.2.3