A logic simulator inspired by Minecraft's "redstone" mechanics. Click on the grid to place a component. Press any key to switch component type. 3 components are included:
c.width=800;c.height=640;a.font="20pt Calibri";d=[];e=[];q="Black Green Gray Lime White Yellow".split(" ");j="None Wire NOT Crossing".split(" ");t=1;for(i=-1;4800>++i;)d[i]=0;e=d.slice(0);c.onmousedown=function(h){x=~~(h.pageX/10);y=~~(h.pageY/10);60>y&&(d[60*x+y]=t)};f=function(){e=d.slice(0);for(i=-1;4800>++i;)3==d[i]&&(d[i]=1);for(i=-1;4800>++i;)try{if(4==d[i]&&(3==e[i+1]||4==e[i+1]))d[i]=2;4==d[i]&&z(i-1);2==d[i]&&3>e[i+1]&&(d[i]=4)}catch(h){}g()};
_=function(h){h--;w(h,0);h+=2;w(h,1);h-=61;w(h,2);w(h+120,3)};w=function(h,k){z(h);if(5==d[h])switch(k){case 0:h--;z(h);break;case 1:h++;z(h);break;case 2:z(h-60);break;case 3:h+=60,z(h)}};z=function(h){1==d[h]&&(d[h]=3,_(h))};g=function(){a.clearRect(0,0,800,640);for(i=-1;4800>++i;)a.fillStyle=q[d[i]],a.fillRect(10*~~(i/60),10*(i%60),9.7,9.7);a.fillStyle=q[t];a.fillText(j[t],350,630);a.strokeStyle="Black";a.strokeText(j[t],350,630)};b.onkeypress=function(){t++;2==t&&(t=4);6==t&&(t=0)};
setInterval(f,50);
Yy53aWR0aD04MDA7Yy5oZWlnaHQ9NjQwO2EuZm9udD0iMjBwdCBDYWxpYnJpIjtkPVtdO2U9W107cT0iQmxhY2sgR3JlZW4gR3JheSBMaW1lIFdoaXRlIFllbGxvdyIuc3BsaXQoIiAiKTtqPSJOb25lIFdpcmUgICBOT1QgQ3Jvc3NpbmciLnNwbGl0KCIgIik7dD0xO2ZvcihpPS0xOzQ4MDA+KytpOylkW2ldPTA7ZT1kLnNsaWNlKDApO2Mub25tb3VzZWRvd249ZnVuY3Rpb24oaCl7eD1+fihoLnBhZ2VYLzEwKTt5PX5+KGgucGFnZVkvMTApOzYwPn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