Last active
March 1, 2019 08:40
-
-
Save mbjelac/eb11eb048a25ea7c846cd56da256fb81 to your computer and use it in GitHub Desktop.
Comment type: 2 algorithms
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
/* | |
a recipe for carrot soup: | |
1. buy carrots & onions at the market (make sure they are fresh!) | |
2. slice carrots | |
3. slice onions | |
4. put carrots, onions & some salt in a pot | |
5. fill pot with water | |
6. heat it up | |
7. wait for the water to start boiling or the carrots to be soft | |
8. turn off heating | |
*/ | |
function createCarrotSoup() { | |
// buy carrots & onions | |
marketplace.signIn(SECRET_CREDENTIALS); | |
carrots = marketplace.buy(CARROT, 5); | |
onions = marketplace.buy(ONION, 1); | |
//validate freshness | |
validateFreshness(carrot, 1); | |
validateFreshness(onion, 1); | |
pot = []; | |
pot.push(carrots, onions, SALT); | |
hotPlate.clear(); | |
hotPlate.add(pot); | |
hotPlate.turnOn(7); | |
// wait | |
while(!pot.isBoiling()) { | |
hotCarrot = pot.takeOut(CARROT, 1); | |
if(hotCarrot.isSoft()) { | |
break; | |
} | |
wait(1000); | |
} | |
hotPlate.turnOff(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
used in The World Of Comments: An Adventure