Advertisement
Aliendreamer

neighbourWars

May 2nd, 2018
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4.    public class StartUp
  5.     {
  6.         static void Main()
  7.         {
  8.             int peshoDamage = int.Parse(Console.ReadLine());
  9.             int goshoDamage = int.Parse(Console.ReadLine());
  10.  
  11.             int peshoHealth = 100;
  12.             int goshoHealth = 100;
  13.             int counter = 1;
  14.            while(peshoHealth>0 || goshoHealth>0)
  15.             {
  16.  
  17.                 if (counter % 2 == 1)
  18.                 {
  19.                     goshoHealth -= peshoDamage;
  20.                     if (goshoHealth <= 0)
  21.                     {
  22.                         Console.WriteLine($"Pesho won in {counter}th round.");
  23.                         break;
  24.                     }
  25.                     Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {goshoHealth} health.");
  26.                 }
  27.  
  28.                 if (counter % 2 == 0)
  29.                 {
  30.                     peshoHealth -= goshoDamage;
  31.                     if (peshoHealth <= 0)
  32.                     {
  33.                         Console.WriteLine($"Gosho won in {counter}th round.");
  34.                         break;
  35.                     }
  36.                     Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {peshoHealth} health.");
  37.                 }
  38.  
  39.                 if (counter%3==0)
  40.                 {
  41.                     peshoHealth += 10;
  42.                     goshoHealth += 10;
  43.                 }
  44.                 counter++;
  45.             }
  46.         }
  47.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement