You are going to have to be more specific but if you are using winapi
you can acquire the text strings from the message EM_GETLINE i believe. There is plenty of documentation online.... http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
you will have to use EM_GETLINEINDEX (i think) beforehand to get the index of the first character. There are examples available on msdn, once again.
We want to store information about what pieces are in which locations. The most natural way to store it would be to index locations by the row and column. This is easily done with a 2-dimensional array:
To declare a 2-D array (of primitive types):
final int BLANK = 0; // location empty
final int WHITE = 1; // white piece
final int BLUE = 2; // blue piece
int board[][] = new int[8][8]; // create 64 integers
board[0][0] = WHITE; // a white piece in row 0, column 0
board[0][1] = BLANK; // row 0, column 1 is empty
board[6][0] = BLUE; // a blue piece in row 6, column 0
Or use a nested loop to load the entire array full of blanks:
for (int i=0; i < 8; i++)
for (int j=0; j < 8; j++)
board[i][j] = BLANK;
Bookmarks