Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.        
  8.         int peshoDmg = int.Parse(Console.ReadLine());
  9.         int goshoDmg = int.Parse(Console.ReadLine());
  10.         int turnCount = 1;
  11.         int peshoHealth = 100;
  12.         int goshoHealth = 100;
  13.         bool peshoTurn = turnCount%2==1;
  14.         bool goshoTurn = turnCount%2==0;
  15.         while (true){
  16.             if (peshoHealth <=0 || goshoHealth <=0){
  17.                 break;
  18.             }
  19.            
  20.             if (turnCount%3==0){
  21.             peshoHealth =peshoHealth+10;
  22.             goshoHealth =goshoHealth+10;
  23.                
  24.             }
  25.             if (peshoTurn){
  26.                 goshoHealth-=peshoDmg;
  27.                 Console.WriteLine("Pesho used Roundhouse kick and reduced Gosho to {0} health.", goshoHealth);
  28.                
  29.             }
  30.             if (goshoTurn) {
  31.                 peshoHealth-=goshoDmg;
  32.                 Console.WriteLine("Gosho used Thunderous fist and reduced Pesho to {0} health.", peshoHealth);
  33.             }
  34.            
  35.  
  36.             turnCount++;
  37.         }
  38.  
  39.        
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement