Mercurial > emacs
comparison lisp/play/gomoku.el @ 74145:8eceefbbcde7
Space/tab mixup.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 24 Nov 2006 10:31:26 +0000 |
parents | 836785857446 |
children | 8d99b6c54739 |
comparison
equal
deleted
inserted
replaced
74144:b302d34b7eae | 74145:8eceefbbcde7 |
---|---|
27 | 27 |
28 ;;; Commentary: | 28 ;;; Commentary: |
29 | 29 |
30 ;; RULES: | 30 ;; RULES: |
31 ;; | 31 ;; |
32 ;; Gomoku is a game played between two players on a rectangular board. Each | 32 ;; Gomoku is a game played between two players on a rectangular board. Each |
33 ;; player, in turn, marks a free square of its choice. The winner is the first | 33 ;; player, in turn, marks a free square of its choice. The winner is the first |
34 ;; one to mark five contiguous squares in any direction (horizontally, | 34 ;; one to mark five contiguous squares in any direction (horizontally, |
35 ;; vertically or diagonally). | 35 ;; vertically or diagonally). |
36 ;; | 36 ;; |
37 ;; I have been told that, in "The TRUE Gomoku", some restrictions are made | 37 ;; I have been told that, in "The TRUE Gomoku", some restrictions are made |
210 ;;; | 210 ;;; |
211 ;;; THE BOARD. | 211 ;;; THE BOARD. |
212 ;;; | 212 ;;; |
213 | 213 |
214 ;; The board is a rectangular grid. We code empty squares with 0, X's with 1 | 214 ;; The board is a rectangular grid. We code empty squares with 0, X's with 1 |
215 ;; and O's with 6. The rectangle is recorded in a one dimensional vector | 215 ;; and O's with 6. The rectangle is recorded in a one dimensional vector |
216 ;; containing padding squares (coded with -1). These squares allow us to | 216 ;; containing padding squares (coded with -1). These squares allow us to |
217 ;; detect when we are trying to move out of the board. We denote a square by | 217 ;; detect when we are trying to move out of the board. We denote a square by |
218 ;; its (X,Y) coords, or by the INDEX corresponding to them in the vector. The | 218 ;; its (X,Y) coords, or by the INDEX corresponding to them in the vector. The |
219 ;; leftmost topmost square has coords (1,1) and index gomoku-board-width + 2. | 219 ;; leftmost topmost square has coords (1,1) and index gomoku-board-width + 2. |
220 ;; Similarly, vectors between squares may be given by two DX, DY coords or by | 220 ;; Similarly, vectors between squares may be given by two DX, DY coords or by |
221 ;; one DEPL (the difference between indexes). | 221 ;; one DEPL (the difference between indexes). |
222 | 222 |