Javascript: Tiny Sodoku Solver, Inception Using Closure

It's amazing what you can do with small bits of JavaScript code minification technique.

Sodoku Solver In 140 bytes

With brute force, some magic and recursion this guy's 140 byte code can solve any Sodoku puzzle.

function R(a,i,j,m,g){for(i=80;a[i];i--||+a);for(m=10;g=a[i]=--m;g&&R(a))for(j in a)g*=a[j^i==j]^m||i/9^j/9&&i%9^j%9&&i/27^j/27|i%9/3^j%9/3}

Argh!! Is it difficult to understand?

He have even annotated his tiny code snippet with easy to understand comments and have released this snippet under some unusual and funny license (Must read LOL!!).

See Code@Gist.

Movie Inception Explained Using Closures!!

Fabrizio Calderan (twitter: @fcalderan) went on explaining movie inception using javascript closure (damn!! from where did he got this idea?) and the result was an amazing JavaScript code which explains lot about working of closures in javascript.

I fired Fabrizio's javascript snippet in firebug and here is what I got. :-o

Explaining Inception Movie In Javascript - Output in Firebug

See Code@Gist.

This entry was published on 30th Sep, 2011.