This is a battleship console game I wrote in C++.#include <string>#include <iostream>#include <process.h>#include <cstdlib>#include <time.h>using namespace std;int const ROW = 3;int const COL = 3;int subX, subY;int guesses = 5;int board[ROW][COL];bool hasWon = false;void winScreen(){    cout << You won with  << guesses <<  guesses left! :)  << endl;}void generateGrid(){    for (int x = 0; x < ROW; x++)    {        for (int y = 0; y < COL; y++)        {            //0 = empty            //1 = has guessed            //2 = sub            //empty board            board[x][y] = 0;            cout << - << x << , << y << - ;        }        cout << endl;    }}void generateSubCoords(){    subX = 0 + (rand() % ROW);    subY = 0 + (rand() % COL);    //2 = sub    board[subX][subY] = 2;}void displayGrid(int changeX, int changeY){    cout << _______________________________________ << endl;    for (int x = 0; x < ROW; x++)    {        for (int y = 0; y < COL; y++)        {            if (x == changeX && y == changeY)            {                if (board[x][y] != 2)                {                    board[x][y] = 1;                }            }            if (board[x][y] == 0)            {                cout << - << x << , << y << - ;            }            else if (board[x][y] == 1)            {                cout << -X,X- ;            }            if (board[x][y] == 2 )            {                if (x == changeX && y == changeY)                {                    cout << -HIT- ;                }                else                {                    cout << - << x << , << y << - ;                }            }        }        cout << endl;    }}void playerGuess(){    int guessX, guessY;    bool goodInput = false;    cout << endl;    do {        cout << guesses <<  guesses left.  << endl;        //get X pick        cout << X: ;        cin >> guessX;        if (guessX < 0 || guessX>2)        {            goodInput = false;            cin.clear();            cin.ignore(256, '\n');            cout << Out of Range! << endl;            //display grid again with X's on board where guessed            break;        }        else        {            goodInput = true;        }        //get Y pick        cout << Y: ;        cin >> guessY;        if (guessY < 0 || guessY>2)        {            goodInput = false;            cin.clear();            cin.ignore(256, '\n');            cout << Out of Range! << endl;            //display grid again with X's on board where guessed            break;        }        else        {            goodInput = true;        }        displayGrid(guessX, guessY);        cout << endl;        guesses--;    } while (!goodInput);    //if guessed right    if (guessX == subX && guessY == subY)    {        hasWon = true;        winScreen();    }}void main(){    srand(time(NULL));    cout << BATTLE-SHIP 2000 << endl << endl;    int board[ROW][COL];    generateGrid();    generateSubCoords();    do    {        if (hasWon)        {            break;        }        playerGuess();    } while (guesses > 0);    //if lost    if (!hasWon)        cout << Sorry, you lost. :( << endl;    cout << The sub was located at - << subX << , << subY << -. << endl;}I really feel like I'm overcomplicating things. I feel like I overuse do whiles and I should try to use a catch and throw option or something a little more creative. Any suggestions would be appreciated.
Battleship console game
c++;array;console