Alright. We need to test to see if the game is won, after marking the last players move on the game grid (the array).
Some things you need to have:
Code:
int won = 0;
while(!won) { //this is the big game loop
show the game grid. For now, show both computer and human ships.
determine who has the move (however you want).
ask the player who has the move, to enter a row and column
print the result - hit or miss
check if the game is won or not. If it's won, give appropriate message, show the game grid, and set won = 1.
}
You have a print grid function, does it work OK?
Who's going to move first, human or computer?
Try putting that into your program, in main.