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
|
int main(){
char grid[6][6] = {
{' ','A','B','C','D','E'},
{'1','O','O','O','O','O'},
{'2','O','O','O','O','O'},
{'3','O','O','O','O','O'},
{'4','O','O','O','O','O'},
{'5','O','O','O','O','O'}};
char character = 'X';
int position[6] = {6,6};
// Draw the grid once
for (int i =0; i < 6; i ++){
for (int j =0; j < 6; j++){
if (i == position[4] && j == position[4])
cout << character;
else
cout << grid[i][j];
cout << " ";
}
cout << endl;
}
return 0;
}
|