Advertisement
Guest User

Neighbour Wars

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