diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-28 16:09:14 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-28 16:09:14 +0000 |
| commit | 80ab4cec14452a641e741d372037dafda16ee871 (patch) | |
| tree | 352324dc62ffbd3c9c651a7154a2e88338144641 /chess-algebraic.el | |
| parent | 7248e5c89f6d53d3f2a4ecf511167af929241f76 (diff) | |
*** no comment ***
Diffstat (limited to 'chess-algebraic.el')
| -rw-r--r-- | chess-algebraic.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chess-algebraic.el b/chess-algebraic.el index 0ae8016..848a97c 100644 --- a/chess-algebraic.el +++ b/chess-algebraic.el @@ -60,16 +60,16 @@ This regexp handles both long and short form.") (defun chess-algebraic-to-ply (position move &optional trust) "Convert the algebraic notation MOVE for POSITION to a ply." + (assert (vectorp position)) + (assert (stringp move)) (when (string-match chess-algebraic-regexp-entire move) (let ((color (chess-pos-side-to-move position)) (mate (match-string 9 move)) (piece (aref move 0)) changes ply) (if (eq piece ?O) - (let ((long (= (length (match-string 1 move)) 5))) - (if (chess-pos-can-castle position (if long (if color ?Q ?q) - (if color ?K ?k))) - (setq changes (chess-ply-create-castle position long)))) + (setq changes (chess-ply-castling-changes + position (= (length (match-string 1 move)) 5))) (let ((promotion (match-string 8 move))) (setq changes (let ((source (match-string 4 move)) @@ -172,6 +172,7 @@ This regexp handles both long and short form.") (defun chess-ply-to-algebraic (ply &optional long) "Convert the given PLY to algebraic notation. If LONG is non-nil, render the move into long notation." + (assert (listp ply)) (let (source san) (cond ((or (null (setq source (chess-ply-source ply))) |
