From b60fd83dd950c2c5ef04f23f25bf0d25ac9c11db Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 8 Apr 2002 03:37:26 +0000 Subject: Simplified the code, removed the 'search-function' nonsense. Even the wackiest chess variants use standard move notation. `chess-ply-create' now fully validates and annotates the plies that it creates, based on the initial piece move (such as the king, in the case of castling). --- chess-pgn.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chess-pgn.el') diff --git a/chess-pgn.el b/chess-pgn.el index db13793..5437a6d 100644 --- a/chess-pgn.el +++ b/chess-pgn.el @@ -19,7 +19,8 @@ (goto-char (match-end 0)) (setq prevpos position) (let* ((move (match-string 0)) - (ply (chess-game-algebraic-to-ply game (match-string 0)))) + (ply (chess-algebraic-to-ply (chess-game-pos game) + (match-string 0)))) (unless ply (error "Error reading move: %s" move)) (setq position (chess-ply-next-pos ply)) @@ -80,8 +81,7 @@ (while plies (unless for-black (when (chess-ply-changes (car plies)) - (insert (format "%d. %s" index - (chess-game-ply-to-algebraic game (car plies)))) + (insert (format "%d. %s" index (chess-ply-to-algebraic (car plies)))) (unless no-annotations (chess-pgn-insert-annotations game index (car plies)))) (setq plies (cdr plies) index (1+ index))) @@ -90,7 +90,7 @@ (when for-black (insert (format "%d. ..." index)) (setq for-black nil)) - (insert (format " %s" (chess-game-ply-to-algebraic game (car plies)))) + (insert (format " %s" (chess-ply-to-algebraic (car plies)))) (unless no-annotations (chess-pgn-insert-annotations game index (car plies)))) (setq plies (cdr plies))) -- cgit v1.2.3