function life(){}

Updates

If you haven’t noticed I haven’t been writing functions latley.
I have been here: http://microsoftcore.tumblr.com it’s my non-function rambleings.

23 February 2009


My Birthday!

<?php
function birthday($date=NULL){

$date = ($date == NULL || $date == “”) ? date(“Y-m-d”) : $date ;

if($date == “2009-02-6”){
return “Yes it is! w00t. <br />”;    
} else {
return “Nope…, Sorry <br />”;
}           


}



print “is it my birthday? <br />”;
print birthday();

?>

shout out to b_heyer for pointing out my repeats.

6 February 2009


I'm free.... free falling.

<?php

$height = 2000;

function falling($height){

$ground = 0;
$free = 1;

for($i=1000;$i>$ground; $i—){

$height = $height + $free;

$i = $i + $free;

}

}

$free = falling($ground);

?>

Free Falling

4 December 2008


5 hour energy

<?php
$time = 1800;

function energy($seconds){

$mm_open = array();

for($seconds;$seconds>=0;$seconds—){

$open = 50;

$eyes_open_mm = ($seconds / $open) . “mm”;

array_push($mm_open, $eyes_open_mm);

}


return $mm_open;

}

$mm = energy($time);
print “<pre>”;
print_r($mm);
print “</pre>”;

?>

4 December 2008


Hmm page won't load. Keeps refreshing

<script type=”text/javascript”>

function refresh(){

location.reload(true);

}

refresh();

</script>

3 December 2008


Tis the season

<?php

function christmas(){

$christmas = date(“U”, strtotime(“december 25”));
$now = date(“U”);
$days_till = round((((($christmas - $now)/60)/60)/24));


return  “Days till Christmas: ” . $days_till;

}

print christmas();

?>

25 November 2008


Days go by

<?php

$days = date(“t”);

days_go_by($days);

function days_go_by($days, $us=”us”, $you=”you”){

do{

if(strstr($us, $you)){

break;

}

$day++;

} while($day <= $days);

}

?>

Days go by - Dirty Vegas

20 November 2008


Word Up

function word($palabra){

$elevation = 4600;
$multiplier = 2;
$flying_at = 0;

for($ft=0;$ft<$elevation;$ft++){

$flying_at = ($ft + $flying_at) * $multiplier;

print “$palabra is currently flying at: $flying_at feet <br />\n”;

}

}

word(“词”);

20 November 2008


Falling asleep is not working...

<?php

$time = array(

‘7pm’ => ‘awake’,
‘7:30pm’ => ‘asleep’,
‘8:00pm’ => ‘still asleep’,
‘11:00pm’ => ‘awake’,
‘11:30pm’ => ‘watching movie’,
‘2:00am’ => ‘typing on tumblr’,
‘2:05am’ => ‘thinking he really should have kept sleeping”

);

function sleep($time){

if(is_array($time)){

foreach($time as $k => $v){

$sleep_schedule .= “It is ” . $k . ” and I am: ” . $v . “<br />\n”;

}

}

return $sleep_schedule;

}

print sleep($time);

?>

20 November 2008


Can't touch this.

<?php

function touch($this){

$stop = 24;

$hammer = 20;

for($you=0;$you < $this;$you++){

if($you == $hammer){

break; // it down

}

}


return $stop . ($hammer + time());

}

?>

song: http://blip.fm/profile/primerx24/blip/1358959

19 November 2008