Neil's News

Polyglot 11: More C

27 November 2004

Last week's C implementation was hobbled by severe limitations of the TurboC compiler. This week I've reimplemented the program with a couple of more advanced compilers.

  1. First is GCC. This implementation uses GD to output the image, making the application web-compatible. The execution speed of C is really quite impressive. When I converted all the math from integers to floats (in order to obtain truecolour display) there was no noticeable difference in speed. I guess our server's got a math coprocessor. I guess I just dated myself quite badly.

    The only part which caused discomfort was the tortured and bizare command line arguments required to link everything together. I'm sure with more experience it will all make sense, but trying to figure out what's needed was a case of trial and error. Mostly error.

    Source code.

  2. Second is LCC. This free (as in beer) Windows C compiler was suggested by Matt Crawford, thanks! The best feature of this application is undoubtedly the EULA. It states in full:

    BY CLICKING "YES" BELOW I PROMISE THAT I WILL READ ALL THE DOCS. I PROMISE THAT I WILL NOT ASK QUESTIONS IN THE FAQ. [Yes] [No]
    The second best feature of this application is that it actually runs on my computer. Unlike the MS Visual C++ compiler which for some reason requires 2000 or XP.

    Source code and an executable.

    Update: It looks like Microsoft changed the graphics API sometime between 98 and 2000. This results in a blank display on 2000 with no obvious indication of what's wrong. Maybe that's why MS's compiler requires 2000 or XP...

Unrelated note: Anyone want a Mac?
Update: Sold for £531.01

< Previous | Next >

 
-------------------------------------
Legal yada yada: My views do not necessarily represent those of my employer or my goldfish.