| Author |
Message |
Vincent Burns (Vince)
| | Posted on Thursday, November 23, 2000 - 12:25 am: | |
is this a good way to do a board scan:? (define find-king (FK a1)(FK a2)(FK a3)(FK a4)(FK a5)(FK a6)(FK a7)(FK a8)) (define FK $1 (while (on-baord? e) e (if piece? King (flag-him)) ) ) (define f (set-position-flag pawn true)) (define bish-flag (while (empty? $1) $1 (set-position-flag bishop true) back) (define rook-flag (while (empty? $1) $1 (set-position-flag rook true) back) (define nite-flag ($1 (set-position-flag nite true) back) (define flag-him mark (bish-flag ne)(bish-flag ne)(bish-flag ne)(bish-flag ne) (rook-flag ne)(rook-flag ne)(rook-flag ne)(rook-flag ne) (nite-flag nne)(nite-flag sse)(nite-flag nnw)(nite-flag sse)(nite-flag ene)(nite-flag ese)(nite-flag wnw)(nite-flag wsw)) (if (am-White?) ne (f) back nw (f) back else se (f) back sw (f) back) |
Joonas Kekoni (Jkekoni)
| | Posted on Monday, March 04, 2002 - 3:34 pm: | |
I have done the following for scanning the board. It wuold be better to start from outside the board, but it would require special arrangements.
a1 (to-four) (while (on-board? e) e (to-four) ) a1 ( while (on-board? n) n mark (to-four) (while (on-board? e) e (to-four) ) back )
|
|