From f115e4627966ae900aef55cb10f9e6207dbe7adf Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 1 Mar 2002 06:17:46 +0000 Subject: Initial revision --- chess-crafty.el | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 chess-crafty.el (limited to 'chess-crafty.el') diff --git a/chess-crafty.el b/chess-crafty.el new file mode 100644 index 0000000..51ca30a --- /dev/null +++ b/chess-crafty.el @@ -0,0 +1,36 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Play against the crafty engine +;; +;; $Revision$ + +(require 'chess-process) + +(defgroup chess-crafty nil + "Interface code for playing against crafty. Uses `chess-process'." + :group 'chess) + +(defcustom chess-crafty-command "crafty" + "The name of the crafty program." + :type 'string + :group 'chess-crafty) + +;;;###autoload +(defun chess-crafty (game) + (chess-process game 'chess-crafty-handler nil + (if (file-name-absolute-p chess-crafty-command) + chess-crafty-command + (executable-find chess-crafty-command)))) + +;;; Code: + +(defun chess-crafty-handler (game buffer command &rest args) + (unless (apply 'chess-process-handler game buffer command args) + (ignore + (if (eq command 'initialize) + (process-send-string (get-buffer-process buffer) + "alarm off\nansi off\n"))))) + +(provide 'chess-crafty) + +;;; chess-crafty.el ends here -- cgit v1.2.3