summaryrefslogtreecommitdiff
path: root/chess-pgn.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-08 03:37:26 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-08 03:37:26 +0000
commitb60fd83dd950c2c5ef04f23f25bf0d25ac9c11db (patch)
treefb1c6e3aced45c08bcd1a3ee173a1c21afeff704 /chess-pgn.el
parent48b77c46e15e664ffeab0c612418f4505c48f7b8 (diff)
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).
Diffstat (limited to 'chess-pgn.el')
-rw-r--r--chess-pgn.el8
1 files changed, 4 insertions, 4 deletions
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)))