• Home
  • About
  • Submit
Digg It Add to Delicious

Pseudocoded

$brain->viewSource()

← How much beer to drink
End date set for “Lost” →

Mother’s day gifts

May 11th, 2007 in Uncategorized | 3 Comments »

if ( $person->age < 13 ) {
 
    $gift = new Item;
    $gift->type = 'handmade';
 
    $mother->give( $gift );
}
else {
 
    $gifts = array();
 
    if ( $person->hasMom() )
        array_push( $gifts, new Item );
 
    if ( $person->hasStepMom() )
        array_push( $gifts, new Item );
 
    if ( $wife and $wife->hasMom() )
        array_push( $gifts, new Item );
 
    if ( $wife and $wife->hasStepMom() )
        array_push( $gifts, new Item );
 
    if ( $sister and ( ! $sister->isMom() )
        and $sister->age > 25)
            array_push( $gifts, new Item );
 
    if ( $wife and $person->hasChildren() ) {    
 
        foreach ( $person->children() as $child ) {        
 
            if ( $child->age < 4 )
                array_push( $gifts, new Item );
        }
    }    
 
    foreach ( $gifts as $gift ) {
        $person->wallet -= $gift->price;
    }    
}

3 Responses to “ Mother’s day gifts ”

  1. # 1 Douglas Karr Says:
    May 13th, 2007 at 10:07 pm

    Oh, if you only knew how hard I was laughing! My son caught me and asked what was so funny. Then he started laughing at me AND you because he couldn’t understand it.

    Awesome site!!!

  2. # 2 ade Says:
    May 14th, 2007 at 9:45 am

    Thanks Doug! You can make this required reading for your son so that he can start to understand it and help you out with some coding work ;)

  3. # 3 Ian Says:
    May 14th, 2007 at 12:40 pm

    I gotta say, as a non programmer I got lost in this one…

  • RSS Subscribe

  • Email Subscribe

  • Archives

    • February 2008
    • January 2008
    • December 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
  • Sponsored By

    FormSpring Online Form Builder


Pseudocoded © 2007   Creative Commons License
Using WordPress Engine and Graphite 1.3 theme.