More movies as code

I must admit that that Movies as Code site got me addicted Smile Here are a few other entries of mine:

Back To The Future

svn merge -r 1985:1955 .

Indiana Jones and the Raiders of the Lost Ark

void RetrieveGoldenIdol()
{
    while(true)
    {
        float dif = bag.Weight - indy.CalculateApproxWeight(idol);
        // 200g of margin should be enough.
        if(dif < -100) bag.AddSand(rand.Next(100, -dif));
        else if(dif > 100) bag.RemoveSand(rand.Next(100, dif));
        else break;
    }
    Swap(bag, idol);
    DeployTraps();
    indy.Run();
}

Jumper

void Jump()
{
    if(Seen("place"))
        goto place;
    return;
place: ;
}

These ones weren’t posted because they were similar to others on the site:

Inception

function goDeeper() {
    if(kick) {
        if(wakeFromKick)
            return;
        else
            Limbo();
    }
    goDeeper();
}

Stargate

void Stargate()
{
earth:
    goto newPlanet;

    // travelling

newPlanet:
    Explore();
    KillGoaulds();

    goto earth;
}
Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *