1. Originally posted by Sebastiani
Arrays come to mind...
Arrays? Not sure what you're meaning is here.

My program is very simple.. a class consisting of an 8x8 char array with '_''s as blank spaces and letters for pieces. The class has a Move() function which takes 4 arguments, x1, y1, x2, and y2. x1,y1 is the starting piece and x2,y2 is the destination. The function checks the coordinates to make sure it is a valid move, and in the if() statement I posted above, those are when the move is valid for a knight.

2. well i have also implemented the game in C... I used an array of 64 to make it simpler.. 8 x 8 has a problem of manuplating validity..

this is how i dod it.. conside there is an array of array[64].. now consider that the king is in the array[40] position.. no to get a valid move i check the move made like this...

consider i = 40;

now valid moves are

array[i+1];
array[i-1];
array[i-8];
array[i+8];
array[i-9];
array[i-7];
array[i+9];
array[i+7];

that is |'''''''|''''''''|'''''''''|
'''''''''''''x'''''''''''''''' |'''''''|''''''''|'''''''''|
''''''''''''''''''''''''''''''
where x is the king.. But this algorithm has a problem.. now conside that the king is in the 8th A8 then the position b1 also become a valid move.. i check this inside the loop... so instead of considering the blocks in this order

1 2 3 4 5 6 7 8
A ------------------------------>--------->
B--------------------------->----------->