Piece Lists
Posted: 10 Jan 2016, 15:34
Hello,
I looked some of these pages https://chessprogramming.wikispaces.com/Piece-Lists and https://pure.uvt.nl/ws/files/1098572/Pr ... 170609.pdf to get a description of how piece lists works. Still, afterwards it seems that they are more than a bit vague to me...
Most of the text books I have read so far, discuss about linked lists, not so much about plain C arrays. So it seems there is plenty of room for experiments here! Anyway I would be grateful for some idea how to use these lists, one or two dimensional arrays. Possibly that could cause some inspiration. I have done some simple programming in c like printing the board to the screen...
I looked some of these pages https://chessprogramming.wikispaces.com/Piece-Lists and https://pure.uvt.nl/ws/files/1098572/Pr ... 170609.pdf to get a description of how piece lists works. Still, afterwards it seems that they are more than a bit vague to me...
Most of the text books I have read so far, discuss about linked lists, not so much about plain C arrays. So it seems there is plenty of room for experiments here! Anyway I would be grateful for some idea how to use these lists, one or two dimensional arrays. Possibly that could cause some inspiration. I have done some simple programming in c like printing the board to the screen...
- Code: Select all
void printboard(int *b)
{
int rank, file, sq, piece;
char PceChar[] = ".PNBRQKpnbrqk";
for (rank = 7; rank >=0; rank--) {
for (file = 0; file <= 7; file++) {
sq = 8*rank+file;
piece = b[sq];
printf("%3c", PceChar[piece]);
}
printf("\n");
}
}