Created
May 22, 2016 04:27
-
-
Save kbk0125/2a8ac5e7853377b9aac3aa59a132a3a0 to your computer and use it in GitHub Desktop.
This file contains 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
var amount= 1000; | |
getCasinoTokens(1000) | |
.then(function(tokens){ | |
return playBlackjack(tokens*0.3) | |
}) | |
.then(function(moreTokens){ | |
return playRoulette(moreTokens*0.05) | |
}) | |
.then(function(evenMoreTokens){ | |
return playPoker(evenMoreTokens*0.5) | |
}) | |
.catch(function(err){ | |
complainToManager(err) | |
startDrinking() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How is the remaining Casino Tokens being tracked after each game? For instance, the playBlackjack function only takes in the betting value, and returns the its win or lose amount, a fraction of which goes to the next game.