947 |
(message "Chicken !"))) |
(message "Chicken !"))) |
948 |
|
|
949 |
(defun gomoku-offer-a-draw () |
(defun gomoku-offer-a-draw () |
950 |
"Offer a draw and return T if Human accepted it." |
"Offer a draw and return t if Human accepted it." |
951 |
(or (y-or-n-p "I offer you a draw. Do you accept it ") |
(or (y-or-n-p "I offer you a draw. Do you accept it ") |
952 |
(not (setq gomoku-human-refused-draw t)))) |
(not (setq gomoku-human-refused-draw t)))) |
953 |
|
|
1095 |
;; who won. The solution is to scan the board along all four directions. |
;; who won. The solution is to scan the board along all four directions. |
1096 |
|
|
1097 |
(defun gomoku-find-filled-qtuple (square value) |
(defun gomoku-find-filled-qtuple (square value) |
1098 |
"Return T if SQUARE belongs to a qtuple filled with VALUEs." |
"Return t if SQUARE belongs to a qtuple filled with VALUEs." |
1099 |
(or (gomoku-check-filled-qtuple square value 1 0) |
(or (gomoku-check-filled-qtuple square value 1 0) |
1100 |
(gomoku-check-filled-qtuple square value 0 1) |
(gomoku-check-filled-qtuple square value 0 1) |
1101 |
(gomoku-check-filled-qtuple square value 1 1) |
(gomoku-check-filled-qtuple square value 1 1) |
1102 |
(gomoku-check-filled-qtuple square value -1 1))) |
(gomoku-check-filled-qtuple square value -1 1))) |
1103 |
|
|
1104 |
(defun gomoku-check-filled-qtuple (square value dx dy) |
(defun gomoku-check-filled-qtuple (square value dx dy) |
1105 |
"Return T if SQUARE belongs to a qtuple filled with VALUEs along DX, DY." |
"Return t if SQUARE belongs to a qtuple filled with VALUEs along DX, DY." |
1106 |
(let ((a 0) (b 0) |
(let ((a 0) (b 0) |
1107 |
(left square) (right square) |
(left square) (right square) |
1108 |
(depl (gomoku-xy-to-index dx dy))) |
(depl (gomoku-xy-to-index dx dy))) |