Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1.             for (int i = 0; i < 10; i++)
  2.             {
  3.                 int wizardAttack = wizard.GetAttackStrength();
  4.                 witcher.TakeAttack(wizardAttack);
  5.  
  6.                 int witcherAttack = witcher.GetAttachStrength();
  7.                 wizard.TakeAttack(witcherAttack);
  8.  
  9.                 if (!wizard.IsAlive()) break;
  10.                 if (!witcher.IsAlive()) break;
  11.  
  12.                 Console.WriteLine($"Witcher {witcher.Name} points: {witcher.HP}");
  13.                 Console.WriteLine($"Wizard {wizard.Name} points: {wizard.HP}");
  14.             }
  15.  
  16.             if (wizard.HP > witcher.HP)
  17.             {
  18.                 Console.BackgroundColor = ConsoleColor.Red;
  19.                 Console.WriteLine($"Wizard {wizard.Name} won!");
  20.                 Console.WriteLine($"Witcher {witcher.Name} points: {witcher.HP}");
  21.                 Console.WriteLine($"Wizard {wizard.Name} points: {wizard.HP}");
  22.             }
  23.             else
  24.             {
  25.                 Console.BackgroundColor = ConsoleColor.Red;
  26.                 Console.WriteLine($"Witcher {witcher.Name} won!");
  27.                 Console.WriteLine($"Witcher {witcher.Name} points: {witcher.HP}");
  28.                 Console.WriteLine($"Witcher {wizard.Name} points: {wizard.HP}");
  29.             }
  30.  
  31.             Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement