summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO46
-rw-r--r--chess-ics.el40
2 files changed, 64 insertions, 22 deletions
diff --git a/TODO b/TODO
index 305c782..eee4553 100644
--- a/TODO
+++ b/TODO
@@ -6,22 +6,62 @@
bughouse/crazyhouse
analysis/highlight tools
database interaction (chess-file.el, chess-scid.el)
- full ICS interaction
----------------------------------------------------------------------
+- modify displays and engines so they ONLY keep game objects; thus
+ set-start-position now is just set-position
+
+- distinguish between chess-display-set-game and
+ chess-display-set-game*. The latter detaches and sets a new game
+ object. The former just overwrites the current game object.
+
- detect draw/resign/abort/retract, etc., from ICS and common engines
- Why doesn't S-b produce [B] in the keyboard shortcutting?
-- chess-sound announcements are broken
-
- the game should go inactive once I lose by stalemate/checkmate
+- there needs to be much more robustness; it's too easy to get the
+ game into an unplayable state right now
+
+- for network transports, if an illegal move is encountered, report
+ this with "illegal move: REASON"
+
+- incorporate any .wav files from xchat's sounds that chess-sound
+ currently doesn't have
+
+- in chess-engine-filter and chess-ics-filter, if an error is
+ encountered, skip that line so the same error isn't triggered again
+
+- in chess-ply-create signal an error on invalid plies describing why
+
+- require `cl' into chess-ply, or break my dependency on cl
+
+- until Fischer Random castling is fully supported, disable castling
+ in the positions generated by chess-random
+
+- test making an en passant capture
+
+- if I parse disambiguating information from chess-algebraic, store
+ this in the ply. Then, in ply-to-algebraic it won't need to be
+ calculated. Also, I can then easily announce it in chess-announce
+
- when announcing abiguous pieces, name the rank/file ("e pawn")
+- in chess-ics use a server-alist, and make the default handle be
+ "guest". Allow a password to be specified, or a filename containing
+ the password
+
+ (HOST [PORT HANDLE PASSWORD HELPER HELPER-ARGS...])
+
+- restrict keyboard shorcutting so that it only looks if the move is
+ related to the given letter
+
----------------------------------------------------------------------
+- Use more asserts throughout the code
+
- Read-only mode needs to be a bit more vigorous. There's nothing
preventing the user from using M-x commands.
diff --git a/chess-ics.el b/chess-ics.el
index 510fd69..4b06a41 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -131,13 +131,14 @@ who is black."
(assert game)
(if (and (chess-game-data game 'active)
(> (chess-game-index game) 0))
- (if (and (cadr info)
- (eq (chess-pos-side-to-move (car info))
- (chess-game-data game 'my-color)))
- (chess-engine-do-move
- (chess-algebraic-to-ply
- (chess-ply-pos (car (last (chess-game-plies game))))
- (cadr info) t)))
+ (when (and (cadr info)
+ (eq (chess-pos-side-to-move (car info))
+ (chess-game-data game 'my-color)))
+ (chess-engine-do-move
+ (chess-algebraic-to-ply
+ (chess-ply-pos (car (last (chess-game-plies game))))
+ (cadr info) t))
+ (assert (equal (car info) (chess-engine-position nil))))
(let ((chess-game-inhibit-events t) plies)
(chess-game-set-data game 'my-color (string= (nth 2 info)
chess-ics-handle))
@@ -199,18 +200,19 @@ who is black."
(if chess-engine-last-pos
(goto-char chess-engine-last-pos)
(goto-char (point-min)))
- (while (and (not (eobp))
- (/= (line-end-position) (point-max)))
- (let ((triggers chess-ics-regexp-alist))
- (while triggers
- ;; this could be accelerated by joining
- ;; together the regexps
- (if (and (looking-at (concat "[^\n\r]*" (caar triggers)))
- (funcall (cdar triggers)))
- (setq triggers nil)
- (setq triggers (cdr triggers)))))
- (forward-line))
- (setq chess-engine-last-pos (point))))
+ (unwind-protect
+ (while (and (not (eobp))
+ (/= (line-end-position) (point-max)))
+ (let ((triggers chess-ics-regexp-alist))
+ (while triggers
+ ;; this could be accelerated by joining
+ ;; together the regexps
+ (if (and (looking-at (concat "[^\n\r]*" (caar triggers)))
+ (funcall (cdar triggers)))
+ (setq triggers nil)
+ (setq triggers (cdr triggers)))))
+ (forward-line))
+ (setq chess-engine-last-pos (point)))))
(defun chess-ics-strip (string)
(while (string-match "[\r\a]" string)