May 11th, 2007
in
Uncategorized |
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;
}
}
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!!!
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 ;)
May 14th, 2007 at 12:40 pm
I gotta say, as a non programmer I got lost in this one…