h1

Baby Logic

March 7, 2007

Think it is fun.

while (still_a_baby == true){
    if (hungry == true ||
        diaper_needs_changing == true ||
        wants_to_play == true ||
        just_feels_like_it == true)
    {
        end_sleep();
        start_cry();
    } else {
        end_cry();
        start_sleep(0;
   }
}
while(1) {
    try
    {
        sleep();
    }
    catch(DiaperException de)
    {
        cry();
    }
    catch(HungryException he)
    {
        try { eat(); }
        catch { cry(); }
    }
    catch(PlayfulException pe)
    {
        try { play(); }
        catch { cry(); }
    }
    catch(Exception e)
    {
        cry();
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: