HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
ASCII fluid dynamics -- IOCCC2012 endoh1.c

Yusuke Endoh · Youtube · 249 HN points · 5 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Yusuke Endoh's video "ASCII fluid dynamics -- IOCCC2012 endoh1.c".
Youtube Summary
A tiny fluid simulator that fits in 80x25 terminal.

http://www.ioccc.org/2012/endoh1/hint.html
http://www.ioccc.org/2012/endoh1/endoh1.c

BGM: Water Music (Handel)
HN Theater Rankings

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).
sixstringtheory
Wow, 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
Jun 08, 2019 · 74 points, 9 comments · submitted by whack
app4soft
I like its logo[0]

      @@@@  @        @     @    @@@@  @               @        @
      @     @              @    @                     @        @@@
      @@@@  @  @  @  @  @@@@    @@@@  @  @@@@@  @  @  @   @@   @     @@   @@@
      @     @  @  @  @  @  @       @  @  @ @ @  @  @  @  @  @  @    @  @  @  @
      @     @   @@@  @  @@@@    @@@@  @  @ @ @   @@@  @   @@ @  @@   @@   @
    
    
    
    
    
    #                                                                          #
    #####                                                                  #####
       ######                                                          ######
           #######                                                #######
                ########                                    ########
                      #########                      #########
                             ##########      ##########
                                     ##      ##
[0] https://www.ioccc.org/2012/endoh1/logo.txt
Twirrim
Source code: https://www.ioccc.org/2012/endoh1/
rand84545
I recommend watching it sped up, on 144p.
heavenlyblue
What 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?
dstanko
Kudos for choice of music for the video ;)
moreati
Is there a directory/collection of these? Simulations/visualizations/animations using the terminal.
new4thaccount
As 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.

aredirect
These kinds of things got me into programming :)
wallflower
Previous (brief) discussion:

https://news.ycombinator.com/item?id=20074185

Video here: https://www.youtube.com/watch?v=QMYfkOtYYlg
maxmcd
Also 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'
buckminster
The video also has color if you watch all of it. And a nice bit of water music.
lelf

  wget 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
nacs
Got 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.

Jun 02, 2019 · 1 points, 0 comments · submitted by ComputerGuru
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

[3]: https://youtu.be/QMYfkOtYYlg

[4]: https://www.ioccc.org/2012/endoh1/endoh1_color.c

slavik81
That was one of the inspirations for my work. His simulation is Lagrangian (particle-based) while mine is Eularian (grid-based).
Mar 06, 2015 · 162 points, 20 comments · submitted by tambourine_man
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.

hellomrjack
Yes, 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!
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 )

Ended
The IOCCC page: 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/

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?

pfortuny
Corners 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. 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

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

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

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.
wetmore
FWIW the guy who made this also made that huge quine from a year or two ago: https://github.com/mame/quine-relay
userbinator
Looks 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.

Nov 25, 2013 · 7 points, 0 comments · submitted by Sukotto
Nov 24, 2013 · 5 points, 0 comments · submitted by sdogruyol
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.