Created
November 16, 2017 21:56
-
-
Save jdleo/2cb29a25bb0020225f2b6065f3ba6248 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const baseBet = 100 | |
| const target = 1.4 | |
| const maxLosses = 3 | |
| const multiplier = 4 | |
| let bet = baseBet | |
| let lossStreak = 0 | |
| while (true) { | |
| const {multiplier} = await this.skip(100,10) | |
| if (multiplier < target) { | |
| lossStreak++ | |
| } else { | |
| lossStreak = 0 | |
| } | |
| while (lossStreak >= maxLosses) { | |
| this.log(`Red streak hit.. betting now`) | |
| const {multiplier} = await this.bet(bet, target) | |
| if (multiplier < target) { | |
| this.log(`Miss.`) | |
| lossStreak++ | |
| bet = bet * multiplier | |
| } else { | |
| this.log(`Hit. Back to skipping!`) | |
| lossStreak = 0 | |
| bet = baseBet | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment