ASCII fluid simulator
November 30, 2013 12:18 AM   Subscribe

 
That channel's "smooth life" automata videos led to this, which I thought was pretty neat.
posted by Valued Customer at 12:41 AM on November 30, 2013 [4 favorites]


Mod note: Now, if we could only merge this with an ASCIIQuarium. Nessie alert.
posted by taz (staff) at 12:57 AM on November 30, 2013 [4 favorites]


Source is in the directory above. That is great, although running a little slower on my machine than in the video.
posted by Wrinkled Stumpskin at 2:19 AM on November 30, 2013 [1 favorite]


Screw you, SGI!
posted by Tell Me No Lies at 2:52 AM on November 30, 2013 [1 favorite]


This is fantastic. I'm always blown away by how much these programmers can do in how few lines of code in these contests. This is from the 21st International Obfuscated C Code Contest. The author, Yusuke Endoh, has quite a few entries in the 22nd as well.
posted by zanni at 3:26 AM on November 30, 2013 [2 favorites]


Neat-o
posted by GallonOfAlan at 3:56 AM on November 30, 2013


Nice!
posted by safetyfork at 4:51 AM on November 30, 2013


All I want for Christmas is an animated ASCII fireplace.
posted by tybeet at 5:46 AM on November 30, 2013


Check your ASCII fluid level every 100,000 keystrokes.
posted by helicomatic at 6:18 AM on November 30, 2013 [4 favorites]


This is very cool.

For those of us of very little brain: Any idea what the different symbols/colours mean? Cells with high velocity/pressure/alcohol content, maybe?
posted by metaBugs at 6:57 AM on November 30, 2013


This is awesome on many levels.

IOCCC entries always blow my mind.
posted by Simon Barclay at 7:14 AM on November 30, 2013


This is totally great. For those of you who ignore source code links, it's worth taking a look. It's what's on the screen at the start of the video, the word "Fluid". As Zanni notes above this is from a contest to make strange and beautiful C programs. The shape of the code is clever, but what's really impressive is how tiny it is. Here's the same code formatted a bit more legibly.

I'm curious about the choice of /\#'- to indicate filled water. The vibration of the /\/\ conveys a lot of turbulence, I guess it works!
posted by Nelson at 7:30 AM on November 30, 2013 [2 favorites]


Reminds me of bb
posted by 256 at 8:05 AM on November 30, 2013


Going into the video blind, I spent a good five seconds looking at that initial title screen going "and?" before I realized it was obfuscated C for the fluid simulator itself rather than just noisy ASCII art.

So great.
posted by cortex at 8:21 AM on November 30, 2013 [1 favorite]


tybeet: "All I want for Christmas is an animated ASCII fireplace."

Ho Ho Ho. Here you go.
posted by schmod at 9:26 AM on November 30, 2013 [4 favorites]


Santa Schmod, you're the best!
posted by tybeet at 10:13 AM on November 30, 2013


Makes me want to write c again... briefly, anyway.
posted by ch1x0r at 10:42 AM on November 30, 2013


By Yusuke Endoh, of Quine Relay fame (previously).
posted by benzenedream at 10:39 PM on November 30, 2013


I downloaded the source and compiled it, and it works as advertised. Nice find!
posted by JHarris at 1:55 AM on December 1, 2013


I'm a big fan of the IOCCC, because it keeps a number of brilliant, slightly crazy people making awesome things like this instead of settling into an underwater lair of evil.
posted by vanar sena at 3:22 AM on December 1, 2013 [3 favorites]


As an exercise, I'm looking through the "unobfuscated" code, and even it is damn hard to understand. I think the first for loop reads the text file into the a array, through a process I'm still working through. The use of complex numbers to represent coordinates is a neat trick.
posted by JHarris at 6:03 AM on December 1, 2013


Yeah, there's a lot of lovely little bits in the code. Like 4[*r++ = w, r] = w + 1. The basic idea there is filling the array pointed to by r with whatever is in w, and it's helpful to remember that 4[r] means the same thing as r[4]. Figure in the , operator and the ++ side effect and you have at least 3 obscure C syntax things crammed into 16 characters (not counting whitespace).
posted by Nelson at 8:31 AM on December 1, 2013 [1 favorite]




Those are great reading kliuless, although they're more about modelling water at the molecular level than fluid dynamics.
posted by JHarris at 2:44 PM on December 1, 2013


« Older Grand Theft Auto Online   |   ‘Insanely more ambitious’ than Google knowledge... Newer »


This thread has been archived and is closed to new comments