Skip to content

Instantly share code, notes, and snippets.

@kbk0125
Created May 22, 2016 04:27
Show Gist options
  • Select an option

  • Save kbk0125/2a8ac5e7853377b9aac3aa59a132a3a0 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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