Last active
June 4, 2016 16:30
-
-
Save mrsimonemms/498129e3300eb61817e34391ad2b75fc to your computer and use it in GitHub Desktop.
How clever are developers
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
// Get the kettle | |
var kettle = Kettle.getKettle(); | |
// Check we have enough water | |
while (kettle.cupsOfWater() < 1) { | |
// No - add water until there's enough | |
kettle.addWater(); | |
} | |
// Boil the kettle | |
kettle.boil() | |
.on('boiled', function () { | |
// Kettle boiled - now make the tea | |
var cuppa = new Tea(); | |
// Is sugar required? | |
if (numberOfSugars > 0) { | |
cuppa.addSugar(numberOfSugars); | |
} | |
// Is milk required? | |
if (milkRequired) { | |
cuppa.addMilk(); | |
} | |
// Finished making - drink your tea | |
cuppa.drink(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment