chess-ics
- finish all elements of regular use as a client
+- takebacks still aren't working 100%
+- display a notice in the minibuffer when a takeback request is sent
chess-ply
- detect games drawn by three-fold repetition
(let ((chess-engine-handling-event t))
(chess-game-undo game (car args))))
+ ((eq event 'flag-fell)
+ (chess-game-set-data game 'active nil)
+ (let ((chess-game-inhibit-events t))
+ (chess-game-end game :flag-fell)))
+
((eq event 'move)
(when (= 1 (chess-game-index game))
(chess-game-set-tag game "White" chess-full-name)
(opp-undo-ret . "Your opponent has retracted their request to undo %d moves")
(opp-illegal . "Your opponent states your last command was illegal")
(opp-call-flag . "Your flag fell, and your opponent has called time")
+ (opp-flag-fell . "Your opponent has forfeited the game on time")
(failed-start . "Failed to start chess engine process")))
(defsubst chess-engine-convert-algebraic (move &optional trust-check)
'black-remaining))))
(when (< remaining 0)
(chess-message 'opp-call-flag)
- (chess-game-end game :flag-fell)
- (chess-game-set-data game 'active nil))))
+ (chess-game-run-hooks game 'flag-fell))))
+
+ ((eq event 'flag-fell)
+ (chess-message 'opp-flag-fell)
+ (chess-game-end game :flag-fell)
+ (chess-game-set-data game 'active nil))
((eq event 'kibitz)
(let ((chess-engine-handling-event t))
(lambda ()
(if (string= (match-string 1) chess-engine-opponent-name)
(funcall chess-engine-response-handler 'resign)))))
+ (cons "\\(\\S-+\\) forfeits on time}"
+ (function
+ (lambda ()
+ (if (string= (match-string 1) chess-engine-opponent-name)
+ (funcall chess-engine-response-handler 'flag-fell)))))
(cons "Illegal move (\\([^)]+\\))\\."
(function
(lambda ()
(function
(lambda ()
(funcall chess-engine-response-handler 'call-flag))))
+ (cons "forfeit$"
+ (function
+ (lambda ()
+ (funcall chess-engine-response-handler 'flag-fell))))
(cons "kibitz\\s-+\\(.+\\)$"
(function
(lambda ()
((eq event 'set-index)
(chess-engine-send nil (format "index %d\n" (car args))))
+ ((eq event 'flag-fell)
+ (chess-engine-send nil "forfeit\n")
+ (chess-common-handler game 'flag-fell))
+
(t
(apply 'chess-common-handler game event args)))))