Skip to content

Instantly share code, notes, and snippets.

@kbk0125
Created May 22, 2016 05:12
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/1b138fd65c56148dfb246496a4d16bdc to your computer and use it in GitHub Desktop.
Save kbk0125/1b138fd65c56148dfb246496a4d16bdc to your computer and use it in GitHub Desktop.
var amount= 1000;
getCasinoTokens(amount)
.then(blackjackTable)
.then(rouletteTable)
.then(pokerTable)
.catch(function(err){
complainToManager(err)
startDrinking()
})
function blackjackTable(tokens){
return playBlackjack(tokens*0.3)
})
function rouletteTable(moreTokens){
return playRoulette(moreTokens*0.05)
})
function pokerTable(evenMoreTokens){
return playPoker(evenMoreTokens*0.5)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment