What data structures would you use to represent a chessboard for a computer chess program?
When creating my chess engine I originally went with the [8][8] approach, however recently I changed my code to represent the chess board using a 64 item array. I found that this implementation was about 1/3 more efficient, at least in my case.
One of the things you want to consider when doing the [8][8] approach is describing positions. For example if you wish to describe a valid move for a chess piece, you will need 2 bytes to do so. While with the [64] item array you can do it with one byte.
To convert from a position on the [64] item board to a [8][8] board you can simply use the following calculations:
Row= (byte)(index / 8)
Col = (byte)(index % 8)
Although I found that you never have to do that during the recursive move searching which is performance sensitive.
For more information on building a chess engine, feel free to visit my blog that describes the process from scratch: www.chessbin.com
Adam Berent