Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.64 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class hearthstone2 {
  3. public static void main(String[] args) {
  4. Scanner sc = new Scanner(System.in);
  5. int rank = 25;
  6. int stars = 0;
  7. int starcap = 2;
  8. int winstreak = 0;
  9. String win = "win";
  10. int legendrank = (int)Math.round(Math.random()*30+500);
  11. System.out.println("Hearthstone Ranked Games. Enter win or lose");
  12. while (rank >= 0){
  13. win = sc.next();
  14. if (rank > 0) {
  15. if (win.equalsIgnoreCase("win")) {
  16. stars++;
  17. winstreak++;
  18. if (rank > 20)
  19. starcap = 2;
  20. else if (rank > 15)
  21. starcap = 3;
  22. else if (rank > 10)
  23. starcap = 4;
  24. else if (rank > 5)
  25. starcap = 5;
  26. else {
  27. starcap = 5;
  28. winstreak = 0;
  29. }
  30. if (winstreak >= 3) {
  31. stars++;
  32. }
  33. if (stars == starcap + 1) {
  34. rank--;
  35. stars = 1;
  36. }
  37. if (stars == starcap + 2) {
  38. rank--;
  39. stars = 2;
  40. }
  41. if (rank > 20)
  42. starcap = 2;
  43. else if (rank > 15)
  44. starcap = 3;
  45. else if (rank > 10)
  46. starcap = 4;
  47. else if (rank > 5)
  48. starcap = 5;
  49. else {
  50. starcap = 5;
  51. winstreak = 0;
  52. }
  53. }
  54.  
  55. if (win.equalsIgnoreCase("lose")) {
  56. if (rank > 20) {
  57. System.out.println("\nYou cannot lose stars at this rank");
  58. winstreak = 0;
  59. } else if (rank == 20 && stars == 0) {
  60. System.out.println("\nYou cannot lose stars at this rank");
  61. winstreak = 0;
  62. } else {
  63. stars--;
  64. winstreak = 0;
  65. if (stars < 0) {
  66. rank++;
  67. if (rank > 20) {
  68. stars = 1;
  69. starcap = 2;
  70. } else if (rank > 15) {
  71. stars = 2;
  72. starcap = 3;
  73. } else if (rank > 10) {
  74. stars = 3;
  75. starcap = 4;
  76. } else {
  77. stars = 4;
  78. starcap = 5;
  79. }
  80. }
  81. }
  82. }
  83. if (winstreak >= 3)
  84. System.out.println("\nWinstreak");
  85. if (rank > 0) {
  86. System.out.println("\nRank: " + rank);
  87. System.out.println(stars + " stars out of " + starcap + " stars");
  88. }
  89. if (rank == 25)
  90. System.out.println("Angry Chicken\n");
  91. if (rank == 24)
  92. System.out.println("Leper Gnome\n");
  93. if (rank == 23)
  94. System.out.println("Argent Squire\n");
  95. if (rank == 22)
  96. System.out.println("Murloc Raider\n");
  97. if (rank == 21)
  98. System.out.println("Southsea Deckhand\n");
  99. if (rank == 20)
  100. System.out.println("Shieldbearer\n");
  101. if (rank == 19)
  102. System.out.println("Novice Engineer\n");
  103. if (rank == 18)
  104. System.out.println("Sorcerer's Apprentice\n");
  105. if (rank == 17)
  106. System.out.println("Tauren Warrior\n");
  107. if (rank == 16)
  108. System.out.println("Questing Adventurer\n");
  109. if (rank == 15)
  110. System.out.println("Silvermoon Guardian\n");
  111. if (rank == 14)
  112. System.out.println("Raid Leader\n");
  113. if (rank == 13)
  114. System.out.println("Dread Corsair\n");
  115. if (rank == 12)
  116. System.out.println("Warsong Commander\n");
  117. if (rank == 11)
  118. System.out.println("Big Game Hunter\n");
  119. if (rank == 10)
  120. System.out.println("Ogre Magi\n");
  121. if (rank == 9)
  122. System.out.println("Silver Hand Knight\n");
  123. if (rank == 8)
  124. System.out.println("Frostwolf Warlord\n");
  125. if (rank == 7)
  126. System.out.println("Sunwalker\n");
  127. if (rank == 6)
  128. System.out.println("Ancient of War\n");
  129. if (rank == 5)
  130. System.out.println("Sea Giant\nWinstreaks are now disabled\n");
  131. if (rank == 4)
  132. System.out.println("Mountain Giant\n");
  133. if (rank == 3)
  134. System.out.println("Molten Giant\n");
  135. if (rank == 2)
  136. System.out.println("The Black Knight\n");
  137. if (rank == 1)
  138. System.out.println("The Innkeeper\n");
  139.  
  140. }
  141. if (rank == 0) {
  142. if (win.equalsIgnoreCase("win")) {
  143. if (legendrank >= 100)
  144. legendrank -= (int) Math.round(Math.random() * 80 + 1);
  145. else if (legendrank >= 50)
  146. legendrank -= (int) Math.round(Math.random() * 30 + 1);
  147. else if (legendrank > 20)
  148. legendrank -= (int) Math.round(Math.random() * 10 + 1);
  149. else if (legendrank <= 20)
  150. legendrank -= (int) Math.round(Math.random() + 1);
  151. else if (legendrank == 2)
  152. legendrank --;
  153. }
  154. if (win.equalsIgnoreCase("lose")) {
  155. if (legendrank >= 100)
  156. legendrank += (int) Math.round(Math.random() * 80 + 1);
  157. else if (legendrank >= 50)
  158. legendrank += (int) Math.round(Math.random() * 30 + 1);
  159. else if (legendrank > 20)
  160. legendrank += (int) Math.round(Math.random() * 10 + 1);
  161. else if (legendrank <= 20)
  162. legendrank += (int) Math.round(Math.random() + 1);
  163. }
  164. if (legendrank == 1)
  165. break;
  166. System.out.println();
  167. System.out.println(legendrank);
  168. System.out.println("Legend\n");
  169. }
  170. }
  171. }
  172. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement