Ok guys so i have a project to do for my c++ class and its supposed to be about two ships (one the player, the other one the computer) and they are on a 10x10 plane created by an array. I did the plane, now how do i get the ships on to their starting positions on the plane? I am really frustrated with this, please help!
This is what i have:
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
const int ROW = 10;
const int COL = 10;
void printBoard (int[][COL]);
int main(int argc, char *argv[])
{
int gameboard[ROW][COL];
printBoard(gameboard);
system("PAUSE");
return EXIT_SUCCESS;
}
void printBoard (int [] [COL])
{
for (int rows = 0; rows < ROW; rows++)
{
for (int collumns = 0; collumns < COL; collumns++)
{
cout << " *";
}
cout << endl;
}
}
I know im supposed to represent them as different characters so "P" would be for the players ship, and "C" is for the computers ship.