1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
void displayBoard(char a, char b, char c, char d) {
//delete the below array, and make a new one with the passed in values.
//a is destination column
//b is desination row
//c is selection column
//d is selection row
//board[a][b] = NULL
//board[c][d] = B or W
char board[9][8] = {
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' },
{ 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' ' },
{ ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B' },
{ 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' ' },
{ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
{ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
{ 'W', ' ', 'W', ' ', 'W', ' ', 'W', ' ' },
{ ' ', 'W', ' ', 'W', ' ', 'W', ' ', 'W' },
{ 'W', ' ', 'W', ' ', 'W', ' ', 'W', ' ' },
};
cout << "Dest & Selection after Function " << endl;
cout << a << " dest column " << endl;
cout << b << " dest row " << endl;
cout << c << " selection column " << endl;
cout << d << " selection row " << endl;
board[a][b] = 'B'; //at this position, change to B
board[c][d] = ' ';//at this position, change to ' '
|