Advertisement
Guest User

Untitled

a guest
May 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public void gamble() {
  2.  
  3. while (balance > 0) {
  4. times++;
  5. System.out.println("balance "+balance);
  6. ran = rng.nextInt(2);
  7.  
  8. if (ran == 1){
  9. winStreak++;
  10. checkWin = true;
  11. }else{
  12. winStreak = 0;
  13. checkWin = false;
  14. }
  15.  
  16. if (!checkWin) {
  17. balance -= betVal;
  18. betVal *=2;
  19. } else {
  20. balance += betVal;
  21. betVal = betValStart;
  22.  
  23. }
  24.  
  25. }
  26. System.out.println("balance "+balance);
  27. System.out.println("times "+times);
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement