1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include "Coordinate.h"
#include "Ship.h"
#include <iostream>
using namespace std;
bool detectCollisions(Ship ships[], int number_of_ships);
int main()
{
Ship ships[4] =
{
Ship(Coordinate(0,0,0), 1, 1, 1),
Ship(Coordinate(5,5,5), 0, 0, 0),
Ship(Coordinate(8,8,8), -1, -1, -1),
Ship(Coordinate(100,100,100), 0,0,0)
};
// code omitted to save room
bool detect_collisions(Ship ships[], int number_of_ships)
{
for (int i = 0; i < number_of_ships; ++i)
{
for (int j = 0; j < number_of_ships; ++j)
{
cout << ships[0].get_location();
}
}
}
|