fun: Movies as code

Google+ brought a wonderful site with really funny snippets of code to represent a movie idea.
2012

function apocalpse() {
     foreach($earth->population as $personIndex => $person) {
          if($person->gotLuck == true) {
               $ark[] = $person;
          }
          elseif($person->gotRidiculousLuck == true) {
               $earth->countries("China")->moveUnder($person);
               $ark[] = $person;
          }
          else { 
               unset($earth->population[$personIndex]); 
          }
     }
}

Inception

int dream_level = 1;

void   go_to_sleep(int dream_level)
{
       dream_level+=1;
       go_to_sleep(dream_level);       
}

int main()
{
     try
     {
             go_to_sleep(dream_level);
     }
     catch(...)
     {
           print("Where am I?");
     }

}

Last of the Mohicans

$(document).ready(function() {
    $('.mohicans').last().find('.hurons').each(function(){
        $(this).remove();
    });
});

The Godfather

$(document).ready(function() {
 jQuery(function(){
    var godfather = $('#god').parent();
});

Cube

public class Cube
{
    public Cube(x, y, z)
    {
        if(!isPrime(x) && !isPrime(y) && !isPrime(z))
            this.add(Trap.random())
    }
}

Leave a Reply

%d bloggers like this: