Int32[] Players = new Int32[100];
Int32 User_Health = 15000;
Int32
User_Attack;
Int32 S = 0;
Random rnd = new Random();
for (int i = 0; i <= 98; i+= 2 )
{
Players[i] = 100;
}
Console.WriteLine("Начнем игру!");
Console.ReadLine();
do
{
User_Attack = rnd.Next(15,30);
for (int i = 1; i <= 99; i += 2)
{
Players[i] = rnd.Next(1, 3);
}
Console.WriteLine("Нажмите 1 для атаки!");
Console.ReadLine();
for (int i = 0; i <= 98; i += 2)
{
User_Health -= Players[i];
}
Console.WriteLine("У тебя осталось здоровья " + User_Health + " единиц");
Console.ReadLine();
for (int i = 0; i <= 98; i += 2)
{
Players[i] -= User_Attack;
}
S++;
if ((S==5)&&(User_Health>0))
{
Console.WriteLine("Ты выжил в 5 раундах и всех победил!");
Console.ReadLine();
Environment.Exit(0);
}
}
while (User_Health >= 0);
Console.WriteLine("Увы и ах( Ты проиграл 5-м противникам!");
Console.ReadLine();
50 противников!!