Function: gomoku-init-board

gomoku-init-board is a byte-compiled function defined in gomoku.el.gz.

Signature

(gomoku-init-board)

Documentation

Create the gomoku-board vector and fill it with initial values.

Source Code

;; Defined in /usr/src/emacs/lisp/play/gomoku.el.gz
(defun gomoku-init-board ()
  "Create the `gomoku-board' vector and fill it with initial values."
  (setq gomoku-board (make-vector gomoku-vector-length 0))
  ;; Every square is 0 (i.e. empty) except padding squares:
  (let ((i 0) (ii (1- gomoku-vector-length)))
    (while (<= i gomoku-board-width)	; The squares in [0..width] and in
      (aset gomoku-board i  -1)		;    [length - width - 1..length - 1]
      (aset gomoku-board ii -1)		;    are padding squares.
      (setq i  (1+ i)
	    ii (1- ii))))
  (let ((i 0))
    (while (< i gomoku-vector-length)
      (aset gomoku-board i -1)		; and also all k*(width+1)
      (setq i (+ i gomoku-board-width 1)))))