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!
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.
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.
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?
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.
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.
20 comments
[ 1.9 ms ] story [ 60.3 ms ] threadBecause he starts with a "cat endoh1.c" to show it's content and it's a valid C program.
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 )
There is also a colour version. Very cool stuff.
Absolutely incredbile, I love the IOCCC.
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?
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.
Well, conservation of volume for these systems with such a large discretization would be more remarkable than its abscence, I guess.
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.
https://www.minaterm.com/endoh1.html
or of course via ssh directly here:
ssh www.minaterm.com (endoh1/endoh1)
http://www.ioccc.org/2012/endoh1/hint.html
http://simulationcorner.net/endoh.html