return;
}
void display(char board[][COLS])
{
int i, j;
// column labels
cout << " ";
for (i = 0; i < COLS; i++)
cout << ' ' << i << ' ';
for (i = 0; i < ROWS; i++)
{
cout << endl;
//row label
cout << i << " ";
for (j = 0; j < COLS; j++)
//don't display the -
if (board[i][j] == '-')
cout << " ";
else
cout << ' ' << board[i][j] << ' ';
cout << endl;
}
return;
}
void save(char board[][COLS])
{
ofstream fout;
int i, j;
fout.open("gameBoard.txt");
for (i = 0; i < ROWS; i++)
{
for (j = 0; j < COLS; j++)
fout << board[i][j] << ' ';
fout << endl;
}
fout.close();
return;
}
void readSaved(char board[][COLS])
{
int i, j;
ifstream fin;
fin.open("gameBoard.txt");
for (i = 0; i < ROWS; i++)
for (j = 0; j < COLS; j++)
fin >> board[i][j];
fin.close();
return;
}