

ASCII fluid dynamics (2013) [video] - tambourine_man
https://m.youtube.com/watch?v=QMYfkOtYYlg

======
userbinator
Looks like the algorithm is based on this:

[http://en.wikipedia.org/wiki/Smoothed-
particle_hydrodynamics](http://en.wikipedia.org/wiki/Smoothed-
particle_hydrodynamics)

The theory behind it is rather more complex than the equations that implement
it - which is why it can be done in such a small amount of code.

It's a similar idea to those tiny raytracers and the basis of many demo
effects: a relatively simple equation, iterated many times, can produce a
complex and even realistic scene.

------
filipedeschamps
Is that "FLUID" written in ascii in the beginning of the video the source code
of this fluid mechanism?

Because he starts with a "cat endoh1.c" to show it's content and it's a valid
C program.

~~~
ptaipale
Yes.

Now, in the spirit of personal computer magazines of 1980's, you should pause
the Youtube video, type in the source code from the screenshot, and run it.
Good luck.

(Us wimps, we get it here:
[http://www.ioccc.org/2012/whowon.html](http://www.ioccc.org/2012/whowon.html)
)

------
Ended
The IOCCC page:
[http://www.ioccc.org/2012/endoh1/hint.html](http://www.ioccc.org/2012/endoh1/hint.html)

There is also a colour version. Very cool stuff.

~~~
squeaky-clean
Here are all the files in the project, including a (somewhat) de-obfuscated
version of the program:
[http://www.ioccc.org/2012/endoh1/](http://www.ioccc.org/2012/endoh1/)

Absolutely incredbile, I love the IOCCC.

------
amelius
Very neat. Is this using actual physics?

In some examples, I get the feeling that the conservation of volume is not
correctly modeled. And in the clock example, how can the fluid escape the
hourglass?

~~~
ColinDabritz
"all models are wrong but some are useful" \- George E. P. Box

[http://en.wikiquote.org/wiki/George_E._P._Box](http://en.wikiquote.org/wiki/George_E._P._Box)

I'm not certain if volume was lost or gained, but it looked possible at some
points. Some of the other modeling seemed a bit 'off' but for so little code
in ASCII it was pretty amazing.

------
new299
For those interested in the color version I've made it available on my server
here on the web here:

[https://www.minaterm.com/endoh1.html](https://www.minaterm.com/endoh1.html)

or of course via ssh directly here:

ssh www.minaterm.com (endoh1/endoh1)

------
gjm11
And the musical accompaniment is ... Handel's _Water Music_. Of course.

~~~
octatoan
I would've preferred Jeux d'eau.

------
s-macke
If someone is interested in the de-obfuscated code take a look in the source
here:

[http://simulationcorner.net/endoh.html](http://simulationcorner.net/endoh.html)

------
Alupis
Here's the ioccc.org page for this entry:

[http://www.ioccc.org/2012/endoh1/hint.html](http://www.ioccc.org/2012/endoh1/hint.html)

------
zatkin
I can't even begin to think of how I would replicate this. Truly impressive
and equally beautiful!

------
miduil
Upload is 2013, but the code is from IOCCC 2012!

------
Sharlin
Would be even more impressive if it were a quine instead of taking the source
as input :)

~~~
jameshart
Run the program on its own sourcecode, Wait til the system stabilizes, take
that ASCII state as output, compile THAT, and have it be the colorized
version. That's how Mel would do it.

~~~
ndrscr
Compile? I don't think Mel would do anything past assemble.

