昆明小虫

这是最好的时期,也是最坏的时期...这是希望的春天,也是失望的冬天...动起来...时刻准备着...
  博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

一个程序员的早上

Posted on 2006-04-13 17:50  昆明小虫  阅读(226)  评论(0编辑  收藏  举报


 
老外写的
 
 
while (!alarm.buzzing()) {
    developer.sleep();
}
developer.wakeUp();
if (!developer.wife().isAwake()) {
    developer.wake(developer.wife());
}

TeaGlass[] glasses = developer.makeTea(2,
Cabinet.getCupboardInstance(), WaterBoiler.getInstance());
Breakfast[] food = new BreakfastWrapper(
  developer.makeToast());

tg1 = glasses[0];
tg2 = glasses[1];

developer.put(food, Kitchen.table);

tg1.fill(wb);
tg2.fill(wb);
while (tg1.getColor() != Color.TeaColor) {
    tg1.dip(tb);
}
while (tg2.getColor() != Color.TeaColor) {
    tg2.dip(tb);
}

if (developer.wife().near()) {
    developer.give(tg2, developer.wife());
} else {
    developer.put(tg2, Kitchen.table());
}

while (!tg1.empty()) {
    try {
        developer.sip(tg1);
    } catch (TooHotException the) {
        developer.say("Ouch!");
        developer.wait(15000);
    }
    if (Shower.free()) {
        break;
    }
}
developer.shower(Shower.getInstance());
developer.eat(food[0]);
developer.brushTeeth((ToothBrush)
    toothbrush.get(developer));
developer.kiss(developer.wife());
developer.bikeToWork();