Created
May 22, 2016 05:12
-
-
Save kbk0125/1b138fd65c56148dfb246496a4d16bdc 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(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