Function: landmark-nb-qtuples

landmark-nb-qtuples is a byte-compiled function defined in landmark.el.gz.

Signature

(landmark-nb-qtuples I J)

Documentation

Return the number of qtuples containing square I,J.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/landmark.el.gz
(defun landmark-nb-qtuples (i j)
  "Return the number of qtuples containing square I,J."
  ;; This function is complicated because we have to deal
  ;; with ugly cases like 3 by 6 boards, but it works.
  ;; If you have a simpler (and correct) solution, send it to me. Thanks !
  (let ((left  (min 4 (1- i)))
	(right (min 4 (- landmark-board-width i)))
	(up    (min 4 (1- j)))
	(down  (min 4 (- landmark-board-height j))))
    (+ -12
       (min (max (+ left right) 3) 8)
       (min (max (+ up down) 3) 8)
       (min (max (+ (min left up) (min right down)) 3) 8)
       (min (max (+ (min right up) (min left down)) 3) 8))))