Advertisement
viraco4a

edit neighbour

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