Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _15.NeighbourWars
- {
- class Program
- {
- static void Main(string[] args)
- {
- int damage1 = int.Parse(Console.ReadLine());
- int damage2 = int.Parse(Console.ReadLine());
- string name1 = "Pesho";
- string name2 = "Gosho";
- string attack1 = "Roundhouse kick";
- string attack2 = "Thunderous fist";
- int health1 = 100;
- int health2 = 100;
- bool turnIsOdd = true;
- int counter = 0;
- while (true)
- {
- if (turnIsOdd)
- {
- health2 -= damage1;
- counter++;
- if (health2 <= 0)
- {
- Console.WriteLine($"{name1} won in {counter}th round.");
- break;
- }
- else
- {
- Console.WriteLine($"{name1} used {attack1} and reduced {name2} to {health2} health.");
- turnIsOdd = false;
- }
- }
- else
- {
- health1 -= damage2;
- counter++;
- if (health1 <= 0)
- {
- Console.WriteLine($"{name2} won in {counter}th round.");
- break;
- }
- else
- {
- Console.WriteLine($"{name2} used {attack2} and reduced {name1} to {health1} health.");
- turnIsOdd = true;
- }
- }
- if (counter % 3 == 0)
- {
- health1 += 10;
- health2 += 10;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement