Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. public static void main (String[] args){
  2. System.out.println("Welcome to Hearthstone Ladder. Enter win or lose");
  3. int rank = 25;
  4. int winstreak = 0;
  5. int stars = 0;
  6. String win = "win";
  7. Scanner sc = new Scanner(System.in);
  8.  
  9. while (rank > 20 && stars < 3){
  10. win = sc.next();
  11. if (win.equals("win")){
  12. if (stars == 2){
  13. rank--;
  14. stars = stars - stars + 1;
  15. winstreak++;
  16. if (winstreak >= 3){
  17. stars++;
  18. System.out.println("Winstreak! Bonus Star! Rank " + rank + " " + stars + " stars");
  19. }
  20. else
  21. System.out.println("Rank " + rank + " " + stars + " stars");
  22. }
  23. else if (stars < 2){
  24. winstreak++;
  25. stars++;
  26. if (winstreak >= 3)
  27. stars++;
  28. System.out.println("Rank " + rank + " " + stars + " stars");
  29. }
  30. if (win.equals("lose")){
  31. winstreak = winstreak - winstreak;
  32. System.out.println("\nYou cannot lose stars at this rank. Rank " + rank + " " + stars + " stars");
  33. }
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement