Function: landmark-init-score-table
landmark-init-score-table is a byte-compiled function defined in
landmark.el.gz.
Signature
(landmark-init-score-table)
Documentation
Create the score table vector and fill it with initial values.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/landmark.el.gz
(defun landmark-init-score-table ()
"Create the score table vector and fill it with initial values."
(if (and landmark-saved-score-table ; Has it been stored last time ?
(= landmark-board-width landmark-saved-board-width)
(= landmark-board-height landmark-saved-board-height))
(setq landmark-score-table (copy-sequence landmark-saved-score-table))
;; No, compute it:
(setq landmark-score-table
(make-vector landmark-vector-length (* 20 landmark-nil-score)))
(let (i j maxi maxj maxi2 maxj2)
(setq maxi (/ (1+ landmark-board-width) 2)
maxj (/ (1+ landmark-board-height) 2)
maxi2 (min 4 maxi)
maxj2 (min 4 maxj))
;; We took symmetry into account and could use it more if the board
;; would have been square and not rectangular !
;; In our case we deal with all (i,j) in the set [1..maxi2]*[1..maxj] U
;; [maxi2+1..maxi]*[1..maxj2]. Maxi2 and maxj2 are used because the
;; board may well be less than 8 by 8 !
(setq i 1)
(while (<= i maxi2)
(setq j 1)
(while (<= j maxj)
(landmark-init-square-score i j)
(setq j (1+ j)))
(setq i (1+ i)))
(while (<= i maxi)
(setq j 1)
(while (<= j maxj2)
(landmark-init-square-score i j)
(setq j (1+ j)))
(setq i (1+ i))))
(setq landmark-saved-score-table (copy-sequence landmark-score-table)
landmark-saved-board-width landmark-board-width
landmark-saved-board-height landmark-board-height)))