Advertisement
Guest User

Untitled

a guest
May 20th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _15.NeighbourWars
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int damage1 = int.Parse(Console.ReadLine());
  10. int damage2 = int.Parse(Console.ReadLine());
  11. string name1 = "Pesho";
  12. string name2 = "Gosho";
  13. string attack1 = "Roundhouse kick";
  14. string attack2 = "Thunderous fist";
  15. int health1 = 100;
  16. int health2 = 100;
  17. bool turnIsOdd = true;
  18. int counter = 0;
  19.  
  20. while (true)
  21. {
  22. if (turnIsOdd)
  23. {
  24. health2 -= damage1;
  25. counter++;
  26.  
  27. if (health2 <= 0)
  28. {
  29. Console.WriteLine($"{name1} won in {counter}th round.");
  30. break;
  31. }
  32. else
  33. {
  34. Console.WriteLine($"{name1} used {attack1} and reduced {name2} to {health2} health.");
  35. turnIsOdd = false;
  36. }
  37. }
  38. else
  39. {
  40. health1 -= damage2;
  41. counter++;
  42.  
  43. if (health1 <= 0)
  44. {
  45. Console.WriteLine($"{name2} won in {counter}th round.");
  46. break;
  47. }
  48. else
  49. {
  50. Console.WriteLine($"{name2} used {attack2} and reduced {name1} to {health1} health.");
  51. turnIsOdd = true;
  52. }
  53. }
  54. if (counter % 3 == 0)
  55. {
  56. health1 += 10;
  57. health2 += 10;
  58. }
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement