Author: Tord Romstad
Date: 07:58:19 01/31/01
Go up one level in this thread
On January 30, 2001 at 17:06:20, Miguel A. Ballicora wrote: >You have a board of 128 squares rather than 64. It is 16x8, ranks 1-8 but you >have 16 columns. Of course, the last 8 columns you never use but this array >is useful to detect when a piece goes out of bounds. > >You declare the board like > >unsigned char board [128]; > >How to detect if a piece is out of the board? >For instance, when you check all the squares that a bishop can go, >in one direction you loop doing square = square + 9; You probably mean 17, not 9. Remember that there are 16 bytes on each rank! Tord
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.