Код: Выделить всё
int heroLife = 10;
int monsterLife = 10;
int round = 1;
do
{
int attackPoint = new Random().Next(1,10);
if(round%2 != 0)
{
monsterLife -= attackPoint;
Console.WriteLine($"Monster was damaged and lost {attackPoint} health and now has {monsterLife} health.");
}
else
{
heroLife -= attackPoint;
Console.WriteLine($"Hero was damaged and lost {attackPoint} health and now has {heroLife} health.");
}
round++;
}while(heroLife
Подробнее здесь: [url]https://stackoverflow.com/questions/78809508/do-while-using-or-in-c-sharp[/url]