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

March 27, 2012 | Documentary | submitted by Jeff Yaus

Outfoxed

.fox-news {
    text-align: right;
}
Vote up this code1

| Drama | submitted by naden

Barneys Version

 
class Actor {
    private $name;
    private $text;
   
    public function __construct($name, $text) {
        $this->name = $name;
        $this->text = $text;
    }
   
    public function __get($what) {
        switch($what) {
            case 'version':
                return $this->name. ': '. $this->text;
            case 'name':
                return $this->name;
        }
    }
}

class Movie {
    private $cast = array();
   
    public function __construct() {    
        $this->cast[] = new Actor('Barney', 'We were drunk. I fired in the air twice. I stumbled. Hit my head. Passed away. I woke up. He was gone.');
    }
   
    public function getActor($name) {
        foreach($this->cast as $cast) {
            if($cast->name == $name) {
                return $cast;
            }
        }        
    }
}

$Movie = new Movie();

print $Movie->getActor('Barney')->version;
?>
Vote up this code7

| Romance | submitted by Jürgen Gentz

Immortal Beloved


FUNCTION UNSTERBLICHE_GELIEBTE() {
$moglichkeiten=array (  "Giulietta Guicciardi",
                                                "Therese Brunsvik",
                                                "Josephine Brunsvik",
                                                "Amalie Sebald",
                                                "Dorothea von Ertmann",
                                                "Antonie Brentano",
                                                "Bettina von Arnim");

foreach($moglichkeiten as $LIEBE)
{if ($BEETHOVEN[$LIEBE]=="Mein Engel"){echo $LIEBE;return;}
}
echo "Niemand";
}

UNSTERBLICHE_GELIEBTE();
?>
Vote up this code0

| Comedy | submitted by Jeff Yaus

Soul Man

#c-thomas-howell {
    color: black !important;
}
Vote up this code2

| Drama | submitted by

Full Metal Jacket

#Gunnery_Sergeant_Hartman {
 text-transform:uppercase;
}
Vote up this code4

| Comedy | submitted by Eyal Gurevitch

White Men Can’t Jump

class Actor {
   string _name;
   bool _isAbleToJump;
   bool _canListenToJimmy;
   bool _canHearJimmy;
   function new (string name) {
      _name = name;
      _canListenToJimmy = true;
   }
}

class WhiteActor like Actor {
   function new (string name) {
      _isAbleToJump = false;   
      _canHearJimmy = false;
   }   
}

class BlackActor like Actor {
   function new (string name) {
      _isAbleToJump = true;
      _canHearJimmy = true;
   }   
}

BlackActor blackActor = new BlackActor ('Wesley Snipes');
WhiteActor whiteActor = new WhiteActor ('Woody Harrelson');

Movie basketballmovie = new Movie (blackActor, whiteActor);
Vote up this code0

| Romance | submitted by Eyal Gurevitch

The Next Best Thing

sub theNextBestThing {
   AllThings.sort();
   return AllThings [ AllThings.size - 1 ];
}
Vote up this code0

| Family | submitted by Joske

We bought a Zoo

Property place;

do {
     place = findNewHome();
} while (place.getClass() != Zoo.class )

buy(property);
Vote up this code1

| Action | submitted by noxius

The Avengers

class Hero{
      boolean isBad = false;
      ArrayList weapons;
      boolean canFly;
      boolean isHot;
      boolean isAlive;
}

class BadGuy extends Hero{
      boolean isBad = true;
}

class Shield{
       ArrayList avengers;
       fight(BadGuy);
}

class Avengers{
       private Shield agency;
       private BadGuy loki;
       
       while (loki.isAlive()){
               agency.avengers.add(random(new Hero()));
               agency.fight(loki);
        }
        System.out.println("End Credits");
}
Vote up this code2

| Comedy | submitted by Kioan

A thousand words

#!/bin/bash

sort -R /usr/share/dict/words | head -n 1000
Vote up this code0