Created
August 29, 2014 14:03
-
-
Save timboslice69/747f67eec6afe634f264 to your computer and use it in GitHub Desktop.
The life of an Eggs Developer
This file contains hidden or 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
/** | |
* Become an eggs developer, look at cats, work on great projects, increase enjoyment! | |
* @returns {EggsDeveloper} | |
* @constructor | |
*/ | |
var EggsDeveloper = function(){ return this; }; | |
EggsDeveloper.prototype = { | |
startDay: function(){ | |
var me = this; | |
me.coffee = 0; | |
me.magic = 0; | |
me.enjoyment = 0; | |
me.catsViewed = 0; | |
me.caffeineSufficient = false; | |
me.finished = false; | |
me.hungry = false; | |
if (!me.caffeineSufficient) me.drinkCoffee(); | |
else me.makeMagic(); | |
}, | |
drinkCoffee: function(){ | |
var me = this; | |
while (!me.caffeineSufficient){ | |
me.coffee++; // [caffeine intensifies] | |
me.enjoyment++; | |
me.caffeineSufficient = (me.coffee > 3); | |
console.log('Coffee: '+ me.coffee + ' Caffeine Sufficient:' + me.caffeineSufficient + ' Enjoyment:' + me.enjoyment); | |
} | |
me.makeMagic(); | |
}, | |
makeMagic: function(){ | |
var me = this; | |
while (!me.hungry && !me.finished && me.caffeineSufficient){ | |
me.magic++; // [coding intensifies] | |
me.catsViewed++; // [reddit intensifies] | |
me.enjoyment++; | |
me.hungry = (me.magic == 50); | |
me.finished = (me.magic == 100); | |
me.caffeineSufficient = !((me.magic == 25) || (me.magic == 75) ); | |
console.log('Magic: '+ me.magic + ' Cats:' + me.catsViewed + ' Enjoyment:' + me.enjoyment); | |
} | |
if (me.hungry) me.eat(); | |
if (me.finished) me.finish(); | |
if (!me.caffeineSufficient) me.drinkCoffee(); | |
}, | |
eat: function(){ | |
var me = this, | |
prepared = true, | |
nutritious = true; | |
if (prepared && nutritious) { | |
me.hungry = false; // [hunger decreases] | |
me.enjoyment += 50; | |
console.log('Hungry: '+ me.hungry + ' Enjoyment:' + me.enjoyment); | |
me.socialize(); | |
} | |
me.makeMagic(); | |
}, | |
finish: function(){ | |
var me = this; | |
me.socialize(); | |
// setTimeout(me.startDay, 86400000); // [life intensifies] | |
}, | |
socialize: function(){ | |
var me = this; | |
me.havingAConversation = true; // [stress decreases] | |
me.beer = (new Date().getHours() > 15); // [relaxation intensifies] | |
me.relaxed = true; | |
me.enjoyment += 50; | |
console.log('Relaxed: '+ me.relaxed + ' Enjoyment:' + me.enjoyment + ' Beer: '+ me.beer); | |
} | |
}; | |
var you = new EggsDeveloper(); | |
you.startDay(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment