Advertisement
martinvalchev

Neighbour_Wars

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