summaryrefslogtreecommitdiff
path: root/chess-game.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-16 02:43:19 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-16 02:43:19 +0000
commitbd0bd1965bbc3a18c0f5a218e417778c295bdd1f (patch)
treec58096b7b958fedf501f98b5cf46c88c723861f7 /chess-game.el
parent40eddef43dfde4f1f14101e1f3bbc0d4621c8a37 (diff)
Major speed improvement and efficiency work. chess-legal-plies is
much more memory conservative now. Reduced recursion in chess-search-position by a slight bit.
Diffstat (limited to 'chess-game.el')
-rw-r--r--chess-game.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/chess-game.el b/chess-game.el
index 2697aec..0bdc76a 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -136,7 +136,7 @@ matches."
(defsubst chess-game-set-start-position (game position)
"Return the tags alist associated with GAME."
- (chess-game-set-plies game (list (chess-ply-create position))))
+ (chess-game-set-plies game (list (chess-ply-create* position))))
(defsubst chess-game-pos (game &optional index)
"Return the position related to GAME's INDEX position."
@@ -207,8 +207,9 @@ Optionally use the given starting POSITION.
TAGS is the starting set of game tags (which can always be changed
later using the various tag-related methods)."
(let ((game (list nil tags nil
- (list (chess-ply-create (or position
- (chess-pos-create)))))))
+ (list (chess-ply-create* (or position
+ (chess-pos-create))
+ (null position))))))
(dolist (tag (cons (cons "Date" (format-time-string "%Y.%m.%d"))
chess-game-default-tags))
(unless (chess-game-tag game (car tag))
@@ -227,8 +228,8 @@ progress (nil), if it is drawn, resigned, mate, etc."
(chess-error 'add-to-completed))
(assert (equal position (chess-ply-pos current-ply)))
(chess-ply-set-changes current-ply changes)
- (chess-game-add-ply game (chess-ply-create
- (chess-ply-next-pos current-ply)))
+ (chess-game-add-ply game (chess-ply-create*
+ (chess-ply-next-pos current-ply) t))
(cond
((chess-ply-any-keyword ply :draw :perpetual :repetition :stalemate)
(chess-game-set-tag game "Result" "1/2-1/2")