bacco

Neighbour Wars

May 16th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 KB | None | 0 0
  1.  using System;
  2.  
  3.  namespace cup
  4.  {
  5.  class Program
  6.  {
  7.     static void Main(string[] args)
  8.         {
  9.              var goshoDamage = int.Parse(Console.ReadLine());
  10.              var peshoDamage = int.Parse(Console.ReadLine());
  11.  
  12.              double peshoHelth = 100;
  13.              double goshoHelth = 100;
  14.  
  15.              var count = 0;
  16.  
  17.          while (peshoHelth >= 1 || goshoHelth >= 1 )
  18.          {
  19.           count++;
  20.              goshoHelth -= goshoDamage;
  21.            
  22.                  if (goshoHelth <= 0)
  23.                  {
  24.                      Console.WriteLine($"Pesho won in {count}th round.");
  25.                      Environment.Exit(0);
  26.                  }
  27.  
  28.              Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {goshoHelth} health.");
  29.  
  30.              if (count % 3 == 0)
  31.              {
  32.                  peshoHelth += 10;
  33.                  goshoHelth += 10;
  34.              }
  35.  
  36.           count++;
  37.              peshoHelth -= peshoDamage;
  38.  
  39.                  if (peshoHelth <= 0)
  40.                  {
  41.                      Console.WriteLine($"Gosho won in {count}th round.");
  42.                      Environment.Exit(0);
  43.                  }
  44.  
  45.              Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {peshoHelth} health.");
  46.  
  47.  
  48.              if (count % 3 == 0)
  49.              {
  50.                 peshoHelth += 10;
  51.                 goshoHelth += 10;
  52.              }
  53.           }
  54.        }
  55.     }
  56.  }
Add Comment
Please, Sign In to add comment