Movies as code - Free your coding mind...

"Unfortunately, no one can be told what the Matrix is. You have to see it for yourself."

Morpheus, The Matrix

May 17, 2011 | Thriller | submitted by Rich Holdsworth

Memento


    //Set up the base vars
    $sceneCount=23;
    $currentScene=1;
    $brainBlownCounter=0;
   
   
    //Assemble the scenes
    while($currentScene <= $sceneCount)
    {
        $scenes[] = 'Scene '.$currentScene;
        $currentScene++;
    }
   
    //Make this film special
    array_reverse($scenes);
   
    //Play
    $sceneCounter =0;
    foreach ($scenes as $somethingThatHappened)
    {
        $sceneCounter++;
   
        $leonardsMemory = $somethingThatHappened;
   
        echo 'We see '.$somethingThatHappened.'
'
;
        echo 'Your brain is now '.(($sceneCounter / count($scenes) * 100)).'% blown.

'
;
   
        $leonardsMemory=NULL;
    }
   
   
    //TODO: Remember Stanley Ipkiss
?>
Vote up this code1

| Comedy | submitted by Phillip David Penny

Ace Ventura: Pet Detective


    $characters = array();
   
    $characters['good'] = 'Finkle';
    $characters['bad'] = 'Einhorn';
   
    $situation = 'Realisation';
   
    if($situation == 'Realisation'){
        echo 'Einhorn is ' . $characters['good'];
        echo 'Finkle is ' . $characters['bad'];
        echo $characters['bad'] . 'is a man?!?!?!';
    }
?>
Vote up this code1

May 14, 2011 | Action | submitted by Ben Howdle

Die Hard


    $characters = array();
   
    $characters['good'] = 'John McClane';
    $characters['bad'] = 'Hans Gruber';
   
    $situation = 'Hostage situation';
   
    if($situation == "Hostage situation"){
        echo "Winner = " . $characters['good'];
        echo "Loser = " . $characters['bad'];
    }
    else {
        $didNotFallOfARoof = $characters['bad'];   
    }

?>
Vote up this code0