Most active commenters
  • (4)
  • cbeach(3)

IOCCC Flight Simulator (2010)

(blog.aerojockey.com)
156 points smig0 | 28 comments | | HN request time: 1.232s | source | bottom
1. ◴[] No.41903400[source]
2. ◴[] No.41903695[source]
3. pvg ◴[] No.41903705[source]
A discussion in 2017 https://news.ycombinator.com/item?id=15058723
4. atan2 ◴[] No.41904015[source]
Classic!
5. 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 #
6. ◴[] No.41904337[source]
7. 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 #
8. dvh ◴[] No.41904475[source]
I couldn't find video of it (yt nor elsewhere)
replies(2): >>41904611 #>>41907265 #
9. cbeach ◴[] No.41904481[source]
Does anyone know of a video online demonstrating this app? I've had a look but can only find screenshots
replies(3): >>41904615 #>>41905252 #>>41905677 #
10. ◴[] No.41904611[source]
11. thih9 ◴[] No.41904723{3}[source]
This is a clip from "The Young Ones S02E03", "Have We Got a Video" montage.

Not a video of the program running.

12. cbeach ◴[] No.41904735{3}[source]
To avoid anyone else wasting a click, this isn't the video
13. thih9 ◴[] No.41904814{3}[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

14. HanClinto ◴[] No.41905010[source]
Wasn't able to find a video of the app working, but did find this Javascript port (?), and it seems to roughly match the appearance shown in screenshots:

https://xyzzy.github.io/jsFlightSim/README.html

replies(1): >>41907250 #
15. account42 ◴[] No.41905252[source]
Compile and run it?
16. jboy55 ◴[] No.41905677[source]
Here you go, https://youtu.be/qvtRfWO_J2M

compiled on my laptop on WSL.

sudo apt install x11-common libx11-dev

make

ran with

cat horizon.sc pittsburgh.sc | ./banks

replies(1): >>41906241 #
17. cbeach ◴[] No.41906241{3}[source]
Amazing, thank you!
18. mianosm ◴[] No.41906309[source]
I’m sure you’ll be making your own scenery files very soon!!!
19. NavinF ◴[] No.41907250[source]
It's very hard to avoid rolling upside down and I wonder if that's intentional. IRL you can just let go of the controls and most aircraft will be stable and fly close to level
replies(2): >>41910247 #>>41911212 #
20. NavinF ◴[] No.41907265[source]
https://news.ycombinator.com/item?id=41905010
21. 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
22. mfex ◴[] No.41907964[source]
After this was posted here in 2017 I made a version in ClojureScript, where you fly over Amsterdam instead of Pittsburg.

http://thegeez.net/2018/04/01/flight.html

23. simonwistow ◴[] No.41908014[source]
On OSX you can install XQuartz and libx11 an then compile it with (assuming you installed libx11 via brew)

  cc banks.c -o banks \
        -DIT=XK_Page_Up -DDT=XK_Page_Down \
        -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
        -DCS=XK_Return -Ddt=0.02 \
        -std=c89 \
        -Wno-unsequenced -Wno-implicit-function-declaration -Wno-implicit-int -Wno-empty-body\
        -lm -lX11 -L/usr/local/Cellar/libx11/1.8.10/lib/ -I/usr/local/Cellar/libx11/1.8.10/include
24. pickledcods ◴[] No.41909342[source]
This entry inspired me to write this javascript implementation to test my high-speed GIF encoder, which I used for animations in the pre-canvas era. It needs keyboard arrows to navigate.

https://xyzzy.github.io/jsFlightSim

I tried to reverse-engineer the code to understand how the model in the simulator worked, only it raised more questions than answered. I did uncover that the author had flight simulator writing experience, so the mechanics were truly obfuscated. Carl, amazing piece of craftsmanship, tipping the hat!

25. gmiller123456 ◴[] No.41909756[source]
My favorite was "the most configurable application ever" and was only one line:

    #include "/dev/tty"
26. simne ◴[] No.41910247{3}[source]
> you can just let go of the controls and most aircraft will be stable

This is not rule.

Some planes named "friendly to novice pilot", and are stable, others are not, and this is somewhere predictable when design.

I even hear, Lindsberg, when was preparing for his flight, asked designer to make his plane unstable, because typical stable flight is very boring and he scared to fall asleep.

In other cases, modern planes like 737s and larger scale, usually considered to have zero stabilization in design and if need, stabilization created by electronics (navigation system is usually made as very high precision inertial platform, so could in most cases know, how should fly to looking stable). This is because design stabilization costs additional resistance, less payload and more fuel consumption - for 737 scale it is about 1-3 additional passengers and few percents of range. Military planes and some aerobatics now are designed unstable for better maneuverability.

I don't say, this new trends are good, just notice.

27. addaon ◴[] No.41911212{3}[source]
Just about all useful airplanes are stable in pitch (either statically stable aerodynamically, or closed-loop stable with an enhanced stability system), but roll stable aircraft are relatively rare. Most aircraft are slightly spiral unstable, at least beyond a critical bank angle; but the double time constant is so slow that it's a non-issue.