yaghouldeadinside

This commit is contained in:
328p
2026-09-23 11:36:42 +03:00
parent 7c87ed82dc
commit 03cc74fdfa
3 changed files with 91 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
using System;
public class Test
{
public static void Main()
{
string name1 = "Пикачу", name2 = "Булбазавр";
int hp1 = 50, hp2 = 55;
int atk1 = 12, atk2 = 10;
int round = 1;
while (hp1 > 0 && hp2 > 0)
{
Console.WriteLine($"\n--- Раунд {round} ---");
hp2 -= atk1;
Console.WriteLine($"{name1} наносит {atk1} урона по {name2}!");
if (hp2 <= 0)
{
hp2 = 0;
Console.WriteLine($"{name2} потерял сознание!");
break;
}
hp1 -= atk2;
Console.WriteLine($"{name2} наносит {atk2} урона по {name1}!");
if (hp1 <= 0)
{
hp1 = 0;
Console.WriteLine($"{name1} потерял сознание!");
break;
}
Console.WriteLine($"Итог раунда: {name1} HP: {hp1} | {name2} HP: {hp2}");
round++;
}
Console.WriteLine("\n=== БОЙ ОКОНЧЕН ===");
if (hp1 > 0)
Console.WriteLine($"Победитель: {name1}!");
else
Console.WriteLine($"Победитель: {name2}!");
}
}
+25
View File
@@ -0,0 +1,25 @@
using System;
public class Test
{
public static void Main()
{
Console.WriteLine("Приготовьтесь!");
for (int i = 3; i >= 1; i--)
Console.WriteLine($"{i}...");
Console.WriteLine("=== БОЙ НАЧИНАЕТСЯ ===");
string pokemon1Name = "Пикачу";
int pokemon1Hp = 50;
int pokemon1Attack = 12;
string pokemon2Name = "Булбазавр";
int pokemon2Hp = 55;
int pokemon2Attack = 10;
int roundNumber = 1;
Console.WriteLine($"{pokemon1Name} (HP: {pokemon1Hp} | Атака: {pokemon1Attack}) VS {pokemon2Name} (HP: {pokemon2Hp} | Атака: {pokemon2Attack})");
}
}
+22
View File
@@ -0,0 +1,22 @@
using System;
public class Test
{
public static void Main()
{
int choice;
do
{
Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): ");
choice = int.Parse(Console.ReadLine());
if (choice == 0)
{
Console.WriteLine("Вы отменили бой!");
return;
}
if (choice != 1)
Console.WriteLine("Некорректная команда! Попробуйте снова.");
} while (choice != 1);
}
}