News for hackers. Stuff that matters.
Re:A turing machine in 133 bytes of javascript by friggeri on Monday November 28, 2011 @11:04AM (#3286381)
Got it down to 118 bytes ;)

    function tm(I,t,e,s,i,c,k){for(i=0;s!=e;i+=k.m,s=k.n){k=I[s][(c=t[i])||"B"];if(!k)return k;t.splice(i,1,k.w)}return t}
You could actually save one more byte by changing the name of the function, but that would be cheating, right ? ;-)

Edit, Refined it to get to 110:

    function tm(I,t,e,s,i,c,k){for(i=0;s!=e;t[i]=k.w,i+=k.m,s=k.n){k=I[s][(c=t[i])||"B"];if(!k)return k;}return t}

There are no comments on this comment yet.