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

April 3, 2012 | Science Fiction | submitted by

Limitless

for(int i = 1; i > 0; i++){
    limit++;
}
Vote up this code6

April 2, 2012 | Action | submitted by

The Dark Knight

batman = { }

gotham =
    criminals: ['The Joker']

batman.fightCrime = -> gotham.criminals.pop()

if batman.parents? isnt true
    while 'The Joker' in gotham.criminals
        batman.fightCrime()
Vote up this code8

| Comedy | submitted by Joske

Glee (show)

public class Show {
    Show() {
        School highSchool = new School();
        highSchool .addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                        singAbout(event);
                }
            });
    }
}
Vote up this code1

| Action | submitted by Joske

Undisputed Trilogy

class BadGuy extends Person() {

}
class Hero extends Person() {

}

class Movie () {
    Movie (Hero h, BadGuy b) {
        hero = h;
        badGuy = b;
    }

    void play () {
        hero.fight(badGuy);
    }
}

class Trilogy () {
    Trilogy() {
        Movie movie = new Movie(new Hero(), new BadGuy() );
        m1.play()

        Movie sequel = new Movie(movie.badGuy, new BadGuy() );
        sequel.play();

        Movie sequel2 = new Movie(sequel .badGuy, new BadGuy() );
        sequel2 .play();
    }
}
Vote up this code0

| Action | submitted by Joske

Gone in 60 seconds

SELECT TOP 50 * INTO boat FROM street where value > 100000
Vote up this code1

| Action | submitted by Mantis Kung Fu

Drunken Mantis

 

class Fighter {
    private $style;
    private $drunk = 0;
    private $vitality = 100;
   
    public function __construct($style) {
        $this->style = $style;
    }
   
    public function consume($liquid) {
        $this->drunk += strlen($liquid);
    }
   
    public function vs($opponent) {
       
        while($opponent->isAlive()) {
            $opponent->pounce();
        }
       
        return 'WON';
    }
   
    private function pounce() {
        $this->vitality -= rand(1, 10);
    }
   
    private function isAlive() {
        return $this->vitality > 0;
    }
}

$Fighter = new Fighter('Mantis Kung Fu');

$Fighter->consume('rice wine');
$Fighter->consume('any booze');
$Fighter->consume('schnapps');
$Fighter->consume('hard liquor');

print $Fighter->vs(new Fighter('some crappy japanese style'));

?>
Vote up this code4

| Action | submitted by noxius

Spartacus (Serie)

public class Spartacus{
     private Person spartacus;

    public static void main(String [] args){
          if(spartacus.isAlive()){
                continue;
          }else{
               continue;
          }
    }
}
Vote up this code1

| Action | submitted by

The Hunt for Red October

#RedOctober {
    float: none;
    display: none;
    z-index: -10;
}
Vote up this code8

March 31, 2012 | Drama | submitted by TK

8 Mile



switch($character) {
    case 'sweet':
        $eminem = 'chocolate candy';
    break;
    case 'bitter':
        $eminem = 'rapper';
    break;
}

if(TRAILER_ROCKIN && !EMINEM_KNOCKIN) {
    $mom = 'whore';
}

$male_best_friends = array();

if(in_array($brittany_murphy, $male_best_friends)) {
    $girl_friend = 'whore';
}

if($mom == 'whore' || $girl_friend == 'whore') {
    $eminem = 'pissed';
}

if($eminem == 'pissed') {
    $rap = 'inspired';
}

$eminem_rounds = 0;
foreach($rap_rounds as $key => $rap_round) {
    $opponent_rap = $free_world_members[$key];
    if($eminem_rap > $opponent_rap) {
        $eminem_rounds += 1;
    }
}

if($eminem_rounds == 3) {
    $end_film = true;
}

if(date('Y') == '2012' && !isset($brittany_murphy)) {
    $brittany_murphy = null;
    die();
}
Vote up this code2

| Drama | submitted by Pitr

Hachiko: A Dog’s Story

public class Hachiko : Dog
{
    private Human boss;
    public Human Boss
    {
        get { return boss; }
        set
        {
            if (boss == null)
            {
                boss == value;
                boss.OnBossReturnFromWork += new EventHandler(OnBossReturnFromWork);
            }
        }
    }

    private Ball Fetch(Ball ball)
    {
        if (DateTime.Today == boss.DeathDate)
            return ball;
        return null;
    }

    private Timer timer;
    private void OnBossReturnFromWork(object sender, EventArgs e)
    {
        boss.OnBossReturnFromWork -= OnBossReturnFromWork;
        timer = new Timer();
        timer.Interval = 24*60*60*1000;
        timer.Tick += new EventHandler(timer_Tick);
        timer.Start();
    }

    void timer_Tick(object sender, EventArgs e)
    {
        GoToTheTrainStation();
        while (human.Location.Distance(this).TotalMeters <= 10)
            Thread.Sleep(1000);
    }
}
Vote up this code4