Skip to content

Instantly share code, notes, and snippets.

@akhikhl
Created July 12, 2013 08:47
Show Gist options
  • Save akhikhl/5982897 to your computer and use it in GitHub Desktop.
Save akhikhl/5982897 to your computer and use it in GitHub Desktop.
My birthday!
class Main {
public void main(String[] args) {
Person p = new Person("Andrey", "Hihlovskiy", "12.07.1969");
boolean hasBirthDayToday = p.hasBirthDay(new Date());
if(hasBirthDayToday)
p.say("Friends", "Hey, guys, have a cake, it's my birthday!")
while(isWorkingHours()) {
p.work();
p.drink(DRINK.COFFEE, STRENGTH.EXTREME, 0.2);
}
if(hasBirthDayToday) {
while(p.getRelaxation() > 1000)
p.drink(DRINK.BEER, STRENGTH.NORMAL, 0.5);
p.say("World", "What a wonderful world!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment