Skip to content

Instantly share code, notes, and snippets.

@kbk0125
Created May 22, 2016 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbk0125/2a8ac5e7853377b9aac3aa59a132a3a0 to your computer and use it in GitHub Desktop.
Save kbk0125/2a8ac5e7853377b9aac3aa59a132a3a0 to your computer and use it in GitHub Desktop.
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()
})
@01abhishekjain
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment