Курсовая работа: Программа "Морской бой"
int shoot_player = ShootPlayer (x, y, 2);
if (shoot_player > 0)
do {
x = rand()% 200;
y = rand()% 200;
int shoot_cpu = ShootPlayer (x, y, 1);
if (shoot_cpu > 0)
break;
if (shoot_cpu < 0)
player -> GetStatus();
if (player -> destroy || target_CPU > 19)
{
EndRaund(1);
return 0;
}
} while(true);
else
{
if (shoot_player < 0)
CPU -> GetStatus();
if (CPU -> destroy || target_player > 19)
{
EndRaund(2);
return 0;
}
}
return 0;
}
// –