How do i put this in board?
Code:
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
const int size_x = 10;
const int size_y = 10;
int field[size_x][size_y];
void board(int location [size_x][size_y], char direction);
void ships(char carrier, char battleship, char cruiser, char submarine, char destroyer);
int main ()
{
char direction;
char name;
char proceed;
cout << "What shp do you want to place" << endl;
cout << "carrier = C "<< endl;
cout << "battleship = B "<< endl;
cout << "cruiser = R "<< endl;
cout << "submarine = S "<< endl;
cout << "destroyer = D \n";
cin >> name;
cout << endl;
do
{
switch (name)//switch statement
{
case 'c':
case 'C': cout << "What coordinates do ya want for this ship ? ";
cin >> direction;
cout << endl;
direction = toupper(direction);
break;
case 'b':
case 'B': cout << "What coordinates do ya want for this ship ? ";
cin >> direction;
cout << endl;
direction = toupper(direction);
break;
case 'r':
case 'R': cout << "What coordinates do ya want for this ship ? ";
cin >> direction;
cout << endl;
direction = toupper(direction);
break;
case 's':
case 'S': cout << "What coordinates do ya want for this ship ? ";
cin >> direction;
cout << endl;
direction = toupper(direction);
break;
case 'd':
case 'D': cout << "What coordinates do ya want for this ship ? ";
cin >> direction;
cout << endl;
direction = toupper(direction);
break;
cout << "Do you want to continue:\n"
<< "y (yes) or n (no)";
cin >> proceed;
proceed ='y';
cout << endl;
default: cout << "Invalid letter." << endl;
}//end of switch
}
while(proceed != 'y');//end of loop
return 0;
}
void ships(char carrier, char battleship, char cruiser, char submarine, char destroyer)
{
}
void location(int& size_x, int& size_y)
{
}