←back to thread

IOCCC Flight Simulator (2010)

(blog.aerojockey.com)
157 points smig0 | 5 comments | | HN request time: 0.202s | source
1. zendist ◴[] No.41904271[source]
How in the world did they come up with the obfuscated code for this? Surely they must be using a tool?
replies(3): >>41904337 #>>41904461 #>>41907406 #
2. ◴[] No.41904337[source]
3. bruce511 ◴[] No.41904461[source]
no, it was a thing back in the 90's (and likely earlier.) The goal was to write a program that was "impossible to read". Some of the winners are seriously creative. And it's very much just smat kids and their machines...

I remember one back in the day which wasn't obfuscated at all. It was clearly a simple utility. Except that it didn't do what you thought it did, it did something completely different. (alas I can't remember the details...)

replies(1): >>41904814 #
4. thih9 ◴[] No.41904814[source]
> I remember one back in the day which wasn't obfuscated at all.

Perhaps it was the Underhanded C Contest[1][2]? It's another competition, entires there often seem simple and perform something unexpected.

[1]: https://en.wikipedia.org/wiki/Underhanded_C_Contest

[2]: https://www.underhanded-c.org

5. thamer ◴[] No.41907406[source]
There are a number of blog posts online and StackOverflow questions explaining IOCCC entries, and they generally seem to be built/obfuscated by hand. It's an art and it's far from trivial, which is one of the reasons why the contest exists :)

For an example, see this StackOverflow question and its detailed answers for an overview of what obfuscation techniques can be used, although many more exist of course: https://stackoverflow.com/questions/15393441/obfuscated-c-co...

I was able to compile it on macOS, but had to include an extra flag to stop clang from being too strict (version 16):

    cc -Wno-implicit-function-declaration -std=c89 -o test test.c
    ./test