ASCII art holds a place near and dear to our hearts. If you were fortunate enough to get started in computers before there was such a thing as a graphical user interface (GUI) then you remember tolling for hours to make clever use of the ASCII characters to make on screen graphics appear as realistic as possible.
Although this animated ASCII fluid dynamics simulator dates back to 2012, it’s just too cool not to share. It’s the product of the International Obfuscated C Code Contest (IOCCC). A contest held each year where the goal is to write the most confusing C code that you can – making use of loopholes and ambiguity in the C programming language to obfuscate(hide) the purpose of the program. Basically, doing everything you’re taught not to do in school. You can take a look at the source code here.
We’re sure the programmer [Yusuke Endoh] would be the first to admit, that there is no practical use for such a low resolution simulator, but we give it an A+ in the retro cool department anyways. (Not to mention, the source code is way too confusing to even comment on) Take a look at the animated ASCII graphics in the video after the break.
The amount of code to do all of that is impressive.
Deobfuscated it is only 31 lines, obfuscated 20 lines.
It reminds me of smallpt where it does global illumination in 100 lines of C code.
This guy did also make a quine with 100 programming languages.
https://github.com/mame/quine-relay
For the non-classicly inclined, thats Handel’s “Water Music” – totally appropriate for the simulation.
Would be slightly more appropriate if it was played on a stepper motor.
Or done by Wendy Carlos.
Thanks, I was searching for it. Beautifull music.
that is pretty awesome.
Amazing bit of code! Mind blown :)
I was a BBS sysop in the early ’90s, I know all about ASCII art. I even wrote my own ASCII art creator program in QuickBASIC.
This brings back memories of those days. :)
Wow… that DOES bring back some memories from the early 90’s…
Isn’t that more appropriately ANSI graphics? The colors kind of point that way…
Ahh… the memories of TheDraw….
It’s all fairly relative, but ANSI graphics were differentiated by the escape sequences (which set the fore/back color, intensity for the fore color, blink, and animation). They all originated from typewriter art from the late 1800’s. ascii art itself was largely the standard ascii character set, and in some cases the extended ascii character set, but did not include the escape sequences, so they did not include colors, or animation. they also didn’t require a driver or a drawing program to view.
Yes, but on most systems you had to use an escape sequence(or the equivalent) to generate non-keyboard characters, even with ASCII.
Increase the resolution, a whole lot, and it could be useful for simulation of real fluids.
>no practical use for such a low resolution simulator
Minecrap?
> Minecrap?
Shithead?
you would have to insert some more sleeps otherwise it would be too fast for java/minecrap
Upon reaching stability you can have some conclusions. (I had coded an ASCII similar in Fortran on a CDC 171. It was like a turn based game. All in b&w).