blob: 2cabeb357641b9704cf41bc27e9f13b3627c01d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Play against phalanx!
;;
;; $Revision$
(require 'chess-engine)
(require 'chess-common)
(defgroup chess-phalanx nil
"The publically available chess engine 'phalanx'."
:group 'chess-engine)
(defcustom chess-phalanx-path (executable-find "phalanx")
"The path to the phalanx executable."
:type 'file
:group 'chess-phalanx)
(defvar chess-phalanx-regexp-alist
(list
(cons (concat "my move is P?\\(" chess-algebraic-regexp "\\)\\s-*$")
(function
(lambda ()
(funcall chess-engine-response-handler 'move
(chess-engine-convert-algebraic (match-string 1))))))
(cons "Illegal move:\\s-*\\(.*\\)"
(function
(lambda ()
(signal 'chess-illegal (match-string 1)))))))
(defun chess-phalanx-handler (event &rest args)
(cond
((eq event 'initialize)
(let ((proc (chess-common-handler 'initialize "phalanx")))
(process-send-string proc "nopost\n")
proc))
(t
(apply 'chess-common-handler event args))))
(provide 'chess-phalanx)
;;; chess-phalanx.el ends here
|