Skip to content

Instantly share code, notes, and snippets.

@podgorniy
Created August 17, 2013 12:14
Show Gist options
  • Save podgorniy/6256627 to your computer and use it in GitHub Desktop.
Save podgorniy/6256627 to your computer and use it in GitHub Desktop.
function in_the_morning () {
var now,
breakfast;
now = me.look_at_watch();
if (now > TOO_LATE || now < TOO_EARLY) {
try {
me.continue_sleeping();
} catch (err) {
me.do_stuff();
now = me.look_at_watch();
if (now < TOO_EARLY) {
in_the_morning();
} else {
return false;
}
}
} else {
me.take_shower({
soap : SOAP,
shampoo : SHAMPOO || SOAP
});
breakfast = me.prepare_breakfast('eggs', 'bacon');
now = me.look_at_watch();
if (breakfast && now < TOO_LATE) {
me.eat(breakfast);
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment