At 10/21/06 02:53 PM, RageOfOrder wrote:
I'll post the source in a bit...
The source in the first link doesn't work correctly in some cases. If you try it with the test board (3rd link) yo find a pawn and a rook are completely removed from the board, and another pawn is in the original place of the rook. It also has no implementation for a bishop ( same problem as a rook ) so just ignore that for now.
The second link works perfectly, but I'm not supposed to do the problem this way, it's too inneficient with all the copying of data from one array to the other...
Source with only one array
Source with two ararys
These are written and compiled using GCC on Linux, so I can't guarantee they will compile under Windows, but they *should*. I just havn't tried it.
In any case, if you can manage to comile ( gcc -o chess3 chess3.c ) then run it with ./chess3 < board6.txt
Here's a screenshot of my output...