Function: gomoku-check-filled-qtuple
gomoku-check-filled-qtuple is a byte-compiled function defined in
gomoku.el.gz.
Signature
(gomoku-check-filled-qtuple SQUARE VALUE DX DY)
Documentation
Return t if SQUARE belongs to a qtuple filled with VALUEs along DX, DY.
Source Code
;; Defined in /usr/src/emacs/lisp/play/gomoku.el.gz
(defun gomoku-check-filled-qtuple (square value dx dy)
"Return t if SQUARE belongs to a qtuple filled with VALUEs along DX, DY."
(let ((a 0) (b 0)
(left square) (right square)
(depl (gomoku-xy-to-index dx dy)))
(while (and (> a -4) ; stretch tuple left
(= value (aref gomoku-board (setq left (- left depl)))))
(setq a (1- a)))
(while (and (< b (+ a 4)) ; stretch tuple right
(= value (aref gomoku-board (setq right (+ right depl)))))
(setq b (1+ b)))
(cond ((= b (+ a 4)) ; tuple length = 5 ?
(gomoku-cross-qtuple (+ square (* a depl)) (+ square (* b depl))
dx dy)
t))))