BubaLazi

15NeighbourWars

Jun 20th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int peshoDamage = int.Parse(Console.ReadLine());
  15.             int goshoDamage = int.Parse(Console.ReadLine());
  16.  
  17.             int peshoHealth = 100;
  18.             int goshoHealth = 100;
  19.  
  20.             int round = 1;
  21.  
  22.             string peshoAtack = "Roundhouse kick";
  23.             string goshoAtack = "Thunderous fist";
  24.  
  25.             while (true)
  26.             {
  27.                 if (round % 2 == 1)
  28.                 {
  29.                     goshoHealth -= peshoDamage;
  30.                     if (goshoHealth <= 0)
  31.                     {
  32.                         Console.WriteLine("Pesho won in {0}th round.", round);
  33.                         break;
  34.                     }
  35.                     else
  36.                     {
  37.                         Console.WriteLine("Pesho used {0} and reduced Gosho to {1} health.", peshoAtack, goshoHealth);
  38.                     }
  39.                     if (round % 3 == 0)
  40.                     {
  41.                         peshoHealth += 10;
  42.                         goshoHealth += 10;
  43.                     }
  44.                 }
  45.                 else
  46.                 {
  47.                     peshoHealth -= goshoDamage;
  48.                     if (peshoHealth <= 0)
  49.                     {
  50.                         Console.WriteLine("Gosho won in {0}th round.", round);
  51.                         break;
  52.                     }
  53.                     else
  54.                     {
  55.                         Console.WriteLine("Gosho used {0} and reduced Pesho to {1} health.", goshoAtack, peshoHealth);
  56.                     }
  57.                     if (round % 3 == 0)
  58.                     {
  59.                         peshoHealth += 10;
  60.                         goshoHealth += 10;
  61.                     }
  62.                 }              
  63.                 round = round + 1;
  64.  
  65.                
  66.  
  67.             }
  68.  
  69.         }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment