Video: Amazing ASCII fluid simulator

[Permalink]

2 Likes

Pretty awesome.

But after seeing what looked like working code used as the program’s header

I realized what I really wanted was a Quine program, where every frame of the ASCII fluid was actually the source for the next frame.

/jaded unpleasable programmer


Edit: I remember now where I got this idea:

Try opening a new tab in your browser and pasting this in the javascript console:

eval(z='p="<"+"pre>"/* ,.oq#+     ,._, */;for(y in n="zw24l6k\
4e3t4jnt4qj24xh2 x/* =<,m#F^    A W###q. */42kty24wrt413n243n\
9h243pdxt41csb yz/* #K       q##H######Am */43iyb6k43pk7243nm\
r24".split(4)){/* dP      cpq#q##########b, */for(a in t=pars\
eInt(n[y],36)+/*         p##@###YG=[#######y */(e=x=r=[]))for\
(r=!r,i=0;t[a/*         d#qg `*PWo##q#######D */]>i;i+=.05)wi\
th(Math)x-= /*        aem1k.com Q###KWR#### W[ */.05,0<cos(o=\
new Date/1e3/*      .Q#########Md#.###OP  A@ , */-x/PI)&&(e[~\
~(32*sin(o)*/* ,    (W#####Xx######.P^     T % */sin(.5+y/7))\
+60] =-~ r);/* #y    `^TqW####P###BP           */for(x=0;122>\
x;)p+="   *#"/* b.        OQ####x#K           */[e[x++]+e[x++\
]]||(S=("eval"/* l         `X#####D  ,       */+"(z=\'"+z.spl\
it(B = "\\\\")./*           G####B" #       */join(B+B).split\
(Q="\'").join(B+Q/*          VQBP`        */)+Q+")//m1k")[x/2\
+61*y-1]).fontcolor/*         TP         */(/\\w/.test(S)&&"#\
03B");document.body.innerHTML=p+=B+"\\n"}setTimeout(z)')//

(or cheat and see it here.)

4 Likes

3 Likes

Yeah, that’s actually the working code of the program that performs the simulation, not a header.

Good ol’ IOCCC… whenever you start feeling cocky about a cool bit of optimization, it’s always easy to take yourself back down a few notches by trying to work out just how the heck some of their entries work.

Suppose you had a great entry into the OCCC, but it did not conform to the ISO C standard. Would you want to remotely debug that program for a judge who couldn’t run your code? -pedantic helps nip these problems in the bud.

1 Like

this is a really cool obsfucated entry as it’s actually somewhat readable.

My favorite is still the horribly unreadable maze generator:
http://www.niksula.hut.fi/~hkankaan/Homepages/mazegen.txt

Don’t let Toady see this.

Cool program, but that is some hyperactive fluid. Low-gravity environment?

“Drowning is fun!™”

This topic was automatically closed after 5 days. New replies are no longer allowed.