Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NeighbourWars
- {
- class Program
- {
- static void Main(string[] args)
- {
- var peshoDamage = int.Parse(Console.ReadLine());
- var goshoDamage = int.Parse(Console.ReadLine());
- var peshoHealth = 100;
- var goshoHealth = 100;
- var attacker = "";
- var attackName = "";
- var defender = "";
- var defenderHealth = 0;
- var winner = "";
- var counter = 0;
- while (peshoHealth > 0 || goshoHealth > 0)
- {
- counter++;
- if (counter % 2 == 0)
- {
- attacker = "Gosho";
- attackName = "Thunderous fist";
- defender = "Pesho";
- peshoHealth -= goshoDamage;
- defenderHealth = peshoHealth;
- winner = "Gosho";
- }
- else
- {
- attacker = "Pesho";
- attackName = "Roundhouse kick";
- defender = "Gosho";
- goshoHealth -= peshoDamage;
- defenderHealth = goshoHealth;
- winner = "Pesho";
- }
- if (counter % 3 == 0)
- {
- peshoHealth += 10;
- goshoHealth += 10;
- }
- if (!(goshoHealth <= 0 || peshoHealth <= 0))
- {
- Console.WriteLine($"{attacker} used {attackName} and reduced {defender} to {defenderHealth} health.");
- }
- else
- {
- break;
- }
- }
- Console.WriteLine($"{winner} won in {counter}th round.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement