Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void gamble() {
- while (balance > 0) {
- times++;
- System.out.println("balance "+balance);
- ran = rng.nextInt(2);
- if (ran == 1){
- winStreak++;
- checkWin = true;
- }else{
- winStreak = 0;
- checkWin = false;
- }
- if (!checkWin) {
- balance -= betVal;
- betVal *=2;
- } else {
- balance += betVal;
- betVal = betValStart;
- }
- }
- System.out.println("balance "+balance);
- System.out.println("times "+times);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement