Is Iron Man made of Lego?

I was re-watching Iron Man recently and noticed something interesting.  During Iron Man’s first “boot up sequence”, in the “terrorist” caves of Nowhereistan, some butchered C code is displayed on a faked up laptop screen.

C source code from Iron Man Movie

The code displayed on screen, although missing some syntactically important characters such as semi-colons, is actual valid C source code.  So valid in fact that I wondered where it came from.

After a quick Google I found it. This code is in fact as follows:

    send[0] = 0x65;
    send[1] = 1;
    send[2] = 3;
    send[3] = 5;
    send[4] = 7;
    send[5] = 11;

    if (rcx_sendrecv(fd, send, 6, recv, 1, 50, RETRIES, use_comp) != 1) {
	fprintf(stderr, "%s: delete firmware failed\n", progname);
	exit(1);
    }

    /* Start firmware download */
    send[0] = 0x75;
    send[1] = (start >> 0) & 0xff;
    send[2] = (start >> 8) & 0xff;
    send[3] = (cksum >> 0) & 0xff;
    send[4] = (cksum >> 8) & 0xff;
    send[5] = 0;

    if (rcx_sendrecv(fd, send, 6, recv, 2, 50, RETRIES, use_comp) != 2) {
	fprintf(stderr, "%s: start firmware download failed\n", progname);
	exit(1);
    }

    /* Transfer data */
    addr = 0;
    index = 1;
    for (addr = 0, index = 1; addr < len; addr += size, index++) {

The code above comes from a firmware downloader for the RCX (a programmable, microcontroller-based Lego brick), written in 1998 at Stanford University by Kekoa Proudfoot. You can get the full source file here and it is distributed under the Mozilla Public License.  This is the same license used by Firefox and many other Open Source software products.

The sequence in the film in which this code appears suggests that the code is either being downloaded as firmware to the Iron Man suit or being used to upload firmware to an RCX Lego brick that is somehow involved in the operation of Iron Man.

So it appears that Iron Man is either powered by Open Source software or made of Lego.  I’m not sure which is cooler.

About these ads

19 thoughts on “Is Iron Man made of Lego?

  1. Ironman 2 shows Ivan Vankoff using Python code (appears in the first 5 minutes into the movie). The code has some regexp code using the “re” module available in python. So whiplash uses opensource software too. ALL HAIL OPENSOURCE!

    The screen sharpens at a monitor for a second and then blurs back. You can see the python code in that.

    IT can be assumed JARVIS uses LISP code because the UI on the monitor looks customized, unlike any windows systems. The layout reminds me of the GUI Richard Stallman was building using Lisp. Not to mention, Americans mostly use Lisp for their AI stuff.

    • All hail open-source, and the producers are obviously hailing the usefulness of code that they can use without having to pay for it!

  2. Pingback: 钢铁侠是乐高做的吗? – Daozhang's Blog

  3. Pingback: Wissenswertes aus aller Welt - Seite 54 - inWoW.de - Das deutsche World of Warcraft / Mists of Pandaria Forum

  4. Pingback: Is Iron Man made of Lego? | Digitale Notdurft

  5. Pingback: Iron Man è fatto di LEGO? | FullPinkyMoon

  6. Pingback: Sometimes code found in movies and TV actually means something | canada.com

  7. Pingback: Is Iron Man made of Lego? | Betteridge’s Law

  8. Pingback: Blog of the Day - Page 18 - DesignersTalk

  9. Pingback: Desvendando os códigos de programação que aparecem em seriados e filmes: A roupa do Iron Man é feita de Lego! : Garotas Geeks

  10. Woah,

    The filmmakers wanted the character to upload some code that would control the robot suit, so they actually bothered to find, not just valid C code, but some actual robot-control software (I think that’s a fair description of Lego Mindstorm) to provide their 2-second snippet of source code.

    That’s some amazing attention to detail.

  11. I’m not sure this is an in-joke or even attention to detail. Due to issues with copyright law, pretty much the only code that COULD be used (except for complete nonsense) would have to be open source, by definition.

  12. Pingback: Web Crush Wednesdays: Source Code in TV and Films | Lady Geek Girl and Friends

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s