Курсовая работа: Программа "Морской бой"
CPU -> ship [col_ship – 1].desp_of_part[i].x = x1 + i;
CPU -> ship [col_ship – 1].desp_of_part[i].y = y1;
}
else
for (i = 0; i < col_deck; i++)
{
CPU -> ship [col_ship – 1].desp_of_part[i].x = x1;
CPU -> ship [col_ship – 1].desp_of_part[i].y = y1 + i;
}
return 0;
}
// –
int Referee: GoChecking (int x, int y, int n)
{
if (n == 1)
if (! Check(net1, x, y))
return 0;
if (n == 2)
if (! Check(net2, x, y))
return 0;
return 1;
}
// –
int Referee: Check (bool net[10] [10], int x, int y)
{
x /= 20; y /= 20;
if (! net[x] [y]) return 0;
return 1;
}