Hacker News Comments on
ASCII fluid dynamics -- IOCCC2012 endoh1.c
Yusuke Endoh
·
Youtube
·
249
HN points
·
5
HN comments
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.This was written by Yusuke Endoh, who also wrote this submission to the IOCCC that I remember being arguably more astonished when I saw it for the first time: https://www.youtube.com/watch?v=QMYfkOtYYlg (ASCII fluid dynamics).
⬐ sixstringtheoryWow, that was cool, never found that one when I went on a deep dive after discovering their quine relay. The other amazing ASCII program of theirs that I love is the Qlobe: http://mamememo.blogspot.com/2010/09/qlobe.html?m=1
Yusuke Endoh is a god amongst men. His C program which creates an approximation of fluid dynamics from any text input is insane - https://www.youtube.com/watch?v=QMYfkOtYYlg
mpv -vo "https://www.youtube.com/watch?v=QMYfkOtYYlg"From https://unix.stackexchange.com/questions/160212/watch-youtub...
⬐ app4softI like its logo[0][0] https://www.ioccc.org/2012/endoh1/logo.txt@@@@ @ @ @ @@@@ @ @ @ @ @ @ @ @ @@@ @@@@ @ @ @ @ @@@@ @@@@ @ @@@@@ @ @ @ @@ @ @@ @@@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@@ @ @@@@ @@@@ @ @ @ @ @@@ @ @@ @ @@ @@ @ # # ##### ##### ###### ###### ####### ####### ######## ######## ######### ######### ########## ########## ## ##
⬐ TwirrimSource code: https://www.ioccc.org/2012/endoh1/⬐ rand84545I recommend watching it sped up, on 144p.⬐ heavenlyblueWhat makes then insides of the liquid have different visuals applied to them? Is that only for aesthetic reasons or is it a function of relative density?⬐ dstankoKudos for choice of music for the video ;)⬐ moreatiIs there a directory/collection of these? Simulations/visualizations/animations using the terminal.⬐ new4thaccount⬐ aredirectAs someone who is kinda a minimalist when it comes to code (prefers simplicity and less libraries and excessive moving parts) I've often wondered about this.The problem is that unless we're just talking about simple charts that act as a debugging/REPL tool, you'll have to redo them for writing reports which is then twice the work.
These kinds of things got me into programming :)⬐ wallflowerPrevious (brief) discussion:
Video here: https://www.youtube.com/watch?v=QMYfkOtYYlg
⬐ maxmcdAlso in color:docker run --rm -it msoap/ascii-art sh -c 'ls /usr/local/share/endoh1/' docker run --rm -it msoap/ascii-art sh -c 'endoh1_color < /usr/local/share/endoh1/tanada.txt' docker run --rm -it msoap/ascii-art sh -c 'endoh1_color < /usr/local/share/endoh1/column.txt'
⬐ buckminsterThe video also has color if you watch all of it. And a nice bit of water music.⬐ lelfwget http://www.ioccc.org/2012/endoh1/endoh1_color.c cc -DG=1 -DP=4 -DV=8 endoh1_color.c -lm # Parameters — factors of gravity, pressure & viscosity ./a.out < endoh1_color.c
⬐ nacsGot it working on Mac with this, thanks!What's amazing to me is that the source code is actually formatted to say "Fluid color" which is why piping the source into the generated binary (as in the 2nd command above) generates that image. Incredible.
These remind me of the ASCII fluid submission [0] at IOCCC 2012 [1] by Yusuke Endoh. The source [2] itself can be used as an input to the program (see video [3]), and he also made a colour version [4].[0]: https://www.ioccc.org/2012/endoh1/hint.html
[1]: https://www.ioccc.org/2012
[2]: https://www.ioccc.org/2012/endoh1/endoh1.c
⬐ slavik81That was one of the inspirations for my work. His simulation is Lagrangian (particle-based) while mine is Eularian (grid-based).
⬐ filipedeschampsIs 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.
⬐ hellomrjack⬐ EndedYes, it compiles in to the solver and then can use its own source as the initial state. The guy who writes these (this is one of his many entries to IOCCC) is a genius!⬐ ptaipaleYes.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 )
The IOCCC page: http://www.ioccc.org/2012/endoh1/hint.htmlThere is also a colour version. Very cool stuff.
⬐ squeaky-clean⬐ ameliusHere are all the files in the project, including a (somewhat) de-obfuscated version of the program: http://www.ioccc.org/2012/endoh1/Absolutely incredbile, I love the IOCCC.
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?
⬐ pfortuny⬐ new299Corners probably.Well, conservation of volume for these systems with such a large discretization would be more remarkable than its abscence, I guess.
⬐ ColinDabritz"all models are wrong but some are useful" - George E. P. Boxhttp://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.
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
or of course via ssh directly here:
ssh www.minaterm.com (endoh1/endoh1)
⬐ gjm11And the musical accompaniment is ... Handel's Water Music. Of course.⬐ octatoan⬐ s-mackeI would've preferred Jeux d'eau.If someone is interested in the de-obfuscated code take a look in the source here:⬐ AlupisHere's the ioccc.org page for this entry:⬐ zatkinI can't even begin to think of how I would replicate this. Truly impressive and equally beautiful!⬐ miduilUpload is 2013, but the code is from IOCCC 2012!⬐ SharlinWould be even more impressive if it were a quine instead of taking the source as input :)⬐ jameshart⬐ userbinatorRun 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⬐ wetmoreCompile? I don't think Mel would do anything past assemble.FWIW the guy who made this also made that huge quine from a year or two ago: https://github.com/mame/quine-relayLooks like the algorithm is based on this: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.