I'm creating 7x10 array that filled 0's unless it is copied by ships.Currently I'm having a problem in which I'm not sure how to place the ships inside this grid.
this is how i've created the map. Please help as I'm a very beginner in c++. Thank you.
void displayBoard()
{
char board [rows][cols];
int num1=0;
int num2=0;
for (int i =1; i <= 7; ++i)
{
for (int j = 1; j <= 9; ++j)
{
cout << " ";
while (num1 <=9)
{
cout << " " << num1;
num1++;
}
}
while (num2 <=7)
{
cout << endl;
cout <<num2 << " | | | | | | | | | | |" << endl;
num2++;
cout << " ========================================…
}
} cout << board[rows][cols];
}