Skip to content

Commit 7260005

Browse files
committed
near final packing
1 parent adfc1f0 commit 7260005

23 files changed

+86
-9
lines changed

1.ch8

-112 Bytes
Binary file not shown.

2.ch8

-280 Bytes
Binary file not shown.

3.ch8

-106 Bytes
Binary file not shown.

4.ch8

-882 Bytes
Binary file not shown.

4.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<body id=b><script>b.innerHTML="<center><style>*{font-family:arial;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;user-select:none}.i{border-radius:50%;display:inline-block;line-height:0;box-shadow:0 0 3px}table .i{vertical-align:top}</style><h1>2-Player games ++</h1><p><button id=C onclick=m=[];f=2;a(p=g=s=1)>Tic-Tac-Toe</button> <button id=D onclick=m=[];f=3;a(p=g=s=1)>Tic-Tac-Toe 3D</button> <button id=E onclick=F.style.opacity=.5;m=[];f=1;a(p=g=s=1)>4 in a row</button> <button id=F onclick=m=[];f=w=0;m[27]=m[36]=-1;m[28]=m[35]=1;a(p=g=s=1)>Reversi</button><p id=z>"; a=function(){l=0;h="<p>";if(0==f){h+="<table border>";for(j=8;j--;)for(h+="<tr>",k=8;k--;)h+="<th width=20 onclick=q("+[l,7-j,7-k]+") id=t"+l+" bgcolor=#5b5>"+["<table bgcolor=0 width=20 height=20 class=i></table>","\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"][1+(m[l]=m[l++]||0)];h+="</table><br>"}if(1==f){h+="<table cellspacing=5 bgcolor=#aad>";for(j=6;j--;)for(h+="<tr>",k=7;k--;)h+="<th width=20 onclick=onclick=q("+[l,7-j,7-k]+") bgcolor=#fff style='border-radius:50%;overflow:hidden'>"+ ["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"][1+(m[l]=m[l++]||0)];h+="</table><br>"}if(2==f){h+="<table style=border-collapse:collapse>";for(j=3;j--;)for(h+="<tr>",k=3;k--;)h+="<th width=20 onclick=q("+[l,7-j,7-k]+") style='"+(j?"border-bottom:2px solid;":"")+(k?"border-right:2px solid;":"")+"'>"+"X\u00a0O"[1+(m[l]=m[l++]||0)];h+="</table><br>"}if(3==f)for(i=3;i--;){h+="<table border style=margin-left:"+4*(1-i)+"em>"; for(j=3;j--;)for(h+="<tr>",k=3;k--;)h+="<th width=20 onclick=q("+[l,7-j,7-k]+")>"+"X\u00a0O"[1+(m[l]=m[l++]||0)];h+="</table><br>"}~m.indexOf(0)?(h+=g?"Next player: <b>"+[["<table bgcolor=0 width=20 height=20 class=i></table>","\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"],["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"],"X\u00a0O","X\u00a0O"][f][p+1]+"</b>":"<b>"+[["<table bgcolor=0 width=20 height=20 class=i></table>", "\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"],["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"],"X\u00a0O","X\u00a0O"][f][-p+1]+"</b> won!",f||(h+="<p><button onclick=a(p=-p)>Pass")):h+=f?g?"draw":[["<table bgcolor=0 width=20 height=20 class=i></table>","\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"],["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"], "X\u00a0O","X\u00a0O"][f][-p+1]+" won!":w?0<w?"<table bgcolor=#fff width=20 height=20 class=i></table> won!":"<table bgcolor=0 width=20 height=20 class=i></table> won!":"Draw!";z.innerHTML=h;~f&&(C.style.opacity=D.style.opacity=E.style.opacity=F.style.opacity=0.5,[F,E,C,D][f].style.opacity=1)}; q=function(c,d,e){if(g&&!m[c]){if(1<f)for(i=3;i--;)for(j=3;j--;)if(k=9*i,l=3*j,~[m[k+j]+m[k+j+3]+m[k+j+6],m[k+l]+m[k+l+1]+m[k+l+2],m[k+4]+m[k+0]+m[k+8],m[k+4]+m[k+2]+m[k+6],m[l+10]+m[l]+m[l+20],m[l+10]+m[l+2]+m[l+18],m[i+12]+m[i]+m[i+24],m[i+12]+m[i+6]+m[i+18],m[13]+m[0]+m[26],m[13]+m[2]+m[24],m[13]+m[6]+m[20],m[13]+m[8]+m[18],m[l+i]+m[l+i+9]+m[l+i+18]].indexOf(3*(m[c]=p)))g=0;if(1==f){for(;35>c&&!m[c+7];c+=7);for(i=6;i--;)for(j=7;j--;)if(k=7*i+j,~[4>j&&m[k]+m[k+1]+m[k+2]+m[k+3],3>i&&m[k]+m[k+7]+ m[k+14]+m[k+21],3>i&&4>j&&m[k]+m[k+8]+m[k+16]+m[k+24],3>i&&2<j&&m[k]+m[k+6]+m[k+12]+m[k+18]].indexOf(4*(m[c]=p)))g=0}if(!f){s=0;for(i=2;~i--;)for(j=2;~j--;)if(i|j&&(t=0,m[8*(d+i)+e+j]==-p)){k=d+i;for(l=e+j;~k&&9>k&&~l&&9>l&&(m[8*k+l]!=p||!(s=t=1))&&m[8*k+l];k+=i,l+=j);if(t)for(u=d,v=e;u!=k||v!=l;u+=i,v+=j)m[8*u+v]=p}w=0;for(i=64;i--;)w+=m[i]}s&&(p=-p);a()}}</script>
1+
<body id=b><script>b.innerHTML="<center><style>*{font-family:arial;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;user-select:none}.i{border-radius:50%;display:inline-block;line-height:0;box-shadow:0 0 3px}table .i{vertical-align:top}</style><h1>2-Player games ++</h1><p><button id=C onclick=m=[];f=2;a(p=g=s=1)>Tic-Tac-Toe</button> <button id=D onclick=m=[];f=3;a(p=g=s=1)>Tic-Tac-Toe 3D</button> <button id=E onclick=F.style.opacity=.5;m=[];f=1;a(p=g=s=1)>4 in a row</button> <button id=F onclick=m=[];f=w=0;m[27]=m[36]=-1;m[28]=m[35]=1;a(p=g=s=1)>Reversi</button><p id=z>"; a=()=>{l=0;h="<p>";if(0==f){h+="<table border>";for(j=8;j--;)for(h+="<tr>",k=8;k--;)h+="<th width=20 onclick=q("+[l,7-j,7-k]+") id=t"+l+" bgcolor=#5b5>"+["<table bgcolor=0 width=20 height=20 class=i></table>","\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"][1+(m[l]=m[l++]||0)];h+="</table><br>"}if(1==f){h+="<table cellspacing=5 bgcolor=#aad>";for(j=6;j--;)for(h+="<tr>",k=7;k--;)h+="<th width=20 onclick=onclick=q("+[l,7-j,7-k]+") bgcolor=#fff style='border-radius:50%;overflow:hidden'>"+["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"][1+(m[l]=m[l++]||0)];h+="</table><br>"}if(2==f){h+="<table style=border-collapse:collapse>";for(j=3;j--;)for(h+="<tr>",k=3;k--;)h+="<th width=20 onclick=q("+[l,7-j,7-k]+") style='"+(j?"border-bottom:2px solid;":"")+(k?"border-right:2px solid;":"")+"'>"+"X\u00a0O"[1+(m[l]=m[l++]||0)];h+="</table><br>"}if(3==f)for(i=3;i--;){h+="<table border style=margin-left:"+4*(1-i)+"em>"; for(j=3;j--;)for(h+="<tr>",k=3;k--;)h+="<th width=20 onclick=q("+[l,7-j,7-k]+")>"+"X\u00a0O"[1+(m[l]=m[l++]||0)];h+="</table><br>"}~m.indexOf(0)?(h+=g?"Next player: <b>"+[["<table bgcolor=0 width=20 height=20 class=i></table>","\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"],["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"],"X\u00a0O","X\u00a0O"][f][p+1]+"</b>":"<b>"+[["<table bgcolor=0 width=20 height=20 class=i></table>", "\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"],["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"],"X\u00a0O","X\u00a0O"][f][-p+1]+"</b> won!",f||(h+="<p><button onclick=a(p=-p)>Pass")):h+=f?g?"draw":[["<table bgcolor=0 width=20 height=20 class=i></table>","\u00a0","<table bgcolor=#fff width=20 height=20 class=i></table>"],["<table bgcolor=red width=20 height=20 class=i></table>","\u00a0","<table bgcolor=yellow width=20 height=20 class=i></table>"],"X\u00a0O","X\u00a0O"][f][-p+1]+" won!":w?0<w?"<table bgcolor=#fff width=20 height=20 class=i></table> won!":"<table bgcolor=0 width=20 height=20 class=i></table> won!":"Draw!";z.innerHTML=h;~f&&(C.style.opacity=D.style.opacity=E.style.opacity=F.style.opacity=0.5,[F,E,C,D][f].style.opacity=1)};q=(c,d,e)=>{if(g&&!m[c]){if(1<f)for(i=3;i--;)for(j=3;j--;)if(k=9*i,l=3*j,~[m[k+j]+m[k+j+3]+m[k+j+6],m[k+l]+m[k+l+1]+m[k+l+2],m[k+4]+m[k+0]+m[k+8],m[k+4]+m[k+2]+m[k+6],m[l+10]+m[l]+m[l+20],m[l+10]+m[l+2]+m[l+18],m[i+12]+m[i]+m[i+24],m[i+12]+m[i+6]+m[i+18],m[13]+m[0]+m[26],m[13]+m[2]+m[24],m[13]+m[6]+m[20],m[13]+m[8]+m[18],m[l+i]+m[l+i+9]+m[l+i+18]].indexOf(3*(m[c]=p)))g=0;if(1==f){for(;35>c&&!m[c+7];c+=7);for(i=6;i--;)for(j=7;j--;)if(k=7*i+j,~[4>j&&m[k]+m[k+1]+m[k+2]+m[k+3],3>i&&m[k]+m[k+7]+ m[k+14]+m[k+21],3>i&&4>j&&m[k]+m[k+8]+m[k+16]+m[k+24],3>i&&2<j&&m[k]+m[k+6]+m[k+12]+m[k+18]].indexOf(4*(m[c]=p)))g=0}if(!f){s=0;for(i=2;~i--;)for(j=2;~j--;)if(i|j&&(t=0,m[8*(d+i)+e+j]==-p)){k=d+i;for(l=e+j;~k&&9>k&&~l&&9>l&&(m[8*k+l]!=p||!(s=t=1))&&m[8*k+l];k+=i,l+=j);if(t)for(u=d,v=e;u!=k||v!=l;u+=i,v+=j)m[8*u+v]=p}w=0;for(i=64;i--;)w+=m[i]}s&&(p=-p);a()}}</script>

5.ch8

-382 Bytes
Binary file not shown.

5.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<center><input onchange="with(new FileReader)readAsArrayBuffer(files[0]),onload=s=>{play(new Uint8Array(result))}"type=file><canvas id=Z width=64 height=32 style="width:320px;height:160px"></canvas><script>S=0;w=[];keys=[96,103,104,105,100,101,102,97,98,99,81,87,69,82,84,89];play=q=>{if(S)clearInterval(S);var p,t,f,a,m,B,g,l,u,r,D,x,n,e,v,c,h,b,d,k,E,y,z,A;p=(C=Z.getContext("2d")).createImageData(64,32);for(a=8192;a--;)p.data[a]=a%4-3?0:255;t=new (AudioContext=this.AudioContext||webkitAudioContext||0);m=[];for(a=80;a--;)m[a]=eval("0x"+"F999F26227F1F8FF1F1F99F11F8F1FF8F9FF1244F9F9FF9F1FF9F99E9E9EF888FE999EF8F8FF8F88"[a]+"0");V=new Uint8Array(new ArrayBuffer(16));B=[];g=512;r=u=l=0;for(a=q.length;a--;)m[a+512]=q[a];S=setInterval(()=>{u&&u--;r&&r--;t&&r&&!f&&(f=t.createOscillator(),f.start||(f.noteOn=f.start),f.stop||(f.noteOff=f.stop),f.connect(t.destination),f.type=3,f.start(0));t&&!r&&f&&(f.stop(0),f=0);for(D=4;D--;){n=m[g]<<8|m[g+1];e=n>>12;v=n&4095;c=n&255;h=n&15;b=n>>8&15;d=V[b];k=V[n>>4&15];if(224==n)for(a=8192;a--;)p.data[a]=a%4-3?0:255;238==n&&(g=B.pop());1==e&&(g=v-2);2==e&&(B.push(g),g=v-2);if(3==e&&d==c||4==e&&d!=c||5==e&&d==k||9==e&&d!=k||14==e&&(158==c&&w[d]||161==c&&!w[d]))g+=2;6==e&&(V[b]=c);7==e&&(V[b]=d+c);8==e&&(h||(V[b]=k),1==h&&(V[b]|=k),2==h&&(V[b]&=k),3==h&&(V[b]^=k),4==h&&(V[15]=+(255<(V[b]+=k))),5==h&&(V[15]=+(0<=(V[b]-=k))),6==h&&(V[15]=d&1,V[b]/=2),7==h&&(V[15]=+(0<=(V[b]=k-d))),14==h&&(V[15]=d>>7,V[b]*=2));10==e&&(l=v);11==e&&(g=v+V[0]);12==e&&(V[b]=Math.floor(Math.random()*c));if(13==e)for(V[15]=0,a=h;a--;)for(y=8;y--;)E=m[l+a]>>7-y&1,z=d+y,A=k+a,E&&(63<z&&(z-=63),31<A&&(A-=31),x=4*(64*A+z)+3,p.data[x]?p.data[x]=0:(p.data[x]=255,V[15]=1));if(15==e){7==c&&(V[b]=u);10==c&&(~(V[b]=w.a(!0))||(g-=2));21==c&&(u=d);24==c&&(r=d);30==c&&(l+=d,V[15]=+(4095<l),l&=4095);41==c&&(l=5*d);if(51==c)for(a=3;a--;)m[l+a]=(""+d)[a];if(85==c)for(a=b;a--;)m[l+a]=V[a];if(101==c)for(a=b;a--;)V[a]=m[l+a]}g+=2}C.putImageData(p,0,0)},16)};onkeydown=q=>{w[keys.indexOf(q.keyCode)]=!0};onkeyup=q=>{w[keys.indexOf(q.keyCode)]=!1};load=(r,x)=>{x=new XMLHttpRequest;x.open('GET',r+".ch8");x.responseType='arraybuffer';x.send();x.onload=()=>{play(new Uint8Array(x.response))}}</script><br>Demo<br><button onclick=load(1)>Rocket2<button onclick=load(2)>Breakout<button onclick=load(3)>X-mirror<button onclick=load(4)>Cave<button onclick=load(5)>Tron
1+
<center><input onchange="with(new FileReader)readAsArrayBuffer(files[0]),onload=s=>{P(new Uint8Array(result))}"type=file><canvas id=Z width=64 height=32 style="width:320px;height:160px"></canvas><script>S=0;w=[];keys=[96,103,104,105,100,101,102,97,98,99,81,87,69,82,84,89];P=q=>{if(S)clearInterval(S);var p,t,f,a,m,B,g,l,u,r,D,x,n,e,v,c,h,b,d,k,E,y,z,A;p=(C=Z.getContext("2d")).createImageData(64,32);for(a=8192;a--;)p.data[a]=a%4-3?0:255;t=new (AudioContext=this.AudioContext||webkitAudioContext||0);m=[];for(a=80;a--;)m[a]=eval("0x"+"f999f26227f1f8ff1f1f99f11f8f1ff8f9ff1244f9f9ff9f1ff9f99e9e9ef888fe999ef8f8ff8f88"[a]+"0");V=new Uint8Array(new ArrayBuffer(16));B=[];g=512;r=u=l=0;for(a=q.length;a--;)m[a+512]=q[a];S=setInterval(()=>{u&&u--;r&&r--;t&&r&&!f&&(f=t.createOscillator(),f.start||(f.noteOn=f.start),f.stop||(f.noteOff=f.stop),f.connect(t.destination),f.type=3,f.start(0));t&&!r&&f&&(f.stop(0),f=0);for(D=4;D--;){n=m[g]<<8|m[g+1];e=n>>12;v=n&4095;c=n&255;h=n&15;b=n>>8&15;d=V[b];k=V[n>>4&15];if(224==n)for(a=8192;a--;)p.data[a]=a%4-3?0:255;238==n&&(g=B.pop());1==e&&(g=v-2);2==e&&(B.push(g),g=v-2);if(3==e&&d==c||4==e&&d!=c||5==e&&d==k||9==e&&d!=k||14==e&&(158==c&&w[d]||161==c&&!w[d]))g+=2;6==e&&(V[b]=c);7==e&&(V[b]=d+c);8==e&&(h||(V[b]=k),1==h&&(V[b]|=k),2==h&&(V[b]&=k),3==h&&(V[b]^=k),4==h&&(V[15]=+(255<(V[b]+=k))),5==h&&(V[15]=+(0<=(V[b]-=k))),6==h&&(V[15]=d&1,V[b]/=2),7==h&&(V[15]=+(0<=(V[b]=k-d))),14==h&&(V[15]=d>>7,V[b]*=2));10==e&&(l=v);11==e&&(g=v+V[0]);12==e&&(V[b]=Math.floor(Math.random()*c));if(13==e)for(V[15]=0,a=h;a--;)for(y=8;y--;)E=m[l+a]>>7-y&1,z=d+y,A=k+a,E&&(63<z&&(z-=63),31<A&&(A-=31),x=4*(64*A+z)+3,p.data[x]?p.data[x]=0:(p.data[x]=255,V[15]=1));if(15==e){7==c&&(V[b]=u);10==c&&(~(V[b]=w.a(!0))||(g-=2));21==c&&(u=d);24==c&&(r=d);30==c&&(l+=d,V[15]=+(4095<l),l&=4095);41==c&&(l=5*d);if(51==c)for(a=3;a--;)m[l+a]=(""+d)[a];if(85==c)for(a=b;a--;)m[l+a]=V[a];if(101==c)for(a=b;a--;)V[a]=m[l+a]}g+=2}C.putImageData(p,0,0)},16)};onkeydown=q=>{w[keys.indexOf(q.keyCode)]=!0};onkeyup=q=>{w[keys.indexOf(q.keyCode)]=!1};d=["00e06414650da228d4556105f1297405d4556101f1297405d4556103f1297405d455a22d7405d455f020a0a0e090a0c0a090","00e0a260600761386219d027d127a25e60006118d011700830401214681e69112258600fe09e12246008f018225879ff22586002f015f007300012366001f0183900122c00e0640cc520c640d65174ff34001248691a122ea268d89700eeff0080808080808080002070707070f85000","6e0565006b066a00a30cdab17a043a4012087b023b1212066c206d1fa310dcd122f660006100a312d0117008a30ed0116040f015f00730001234c60f671e680169ffa30ed671a310dcd16004e0a17cfe6006e0a17c02603f8c02dcd1a30ed67186848794603f8602611f8712471f12ac46006801463f68ff47006901d6713f0112aa471f12aa600580753f0012aa6001f018806061fc8012a30cd07160fe890322f6750122f6456012de124669ff806080c53f0112ca610280153f0112e080153f0112ee80153f0112e86020f018a30e7eff80e080046100d0113e00123012de78ff48fe68ff12ee7801480268016004f01869ff1270a314f533f265f12963376400d3457305f229d34500eef0008000fc00aa0000000000","661e670f681f690f6a1e6b106c1f6d10a268222e6002e0a122446008e0a122386004e0a122506006e0a1225c1214d671d891dab1dcd100ee77ff79ff7b017d01222e00ee770179017bff7dff222e00ee76ff78017aff7c01222e00ee760178ff7a017cff222e00ee8000","00e064006500a20a120ccc33661ed452d46274084440121a120ea21e122cffffc0c0c0c0c0c0c0c0c0c0ffff640d6509d45e740aa23ad45e1248ffffc3c3c3c3c3ffffc3c3c3c3c3740aa250d45e125ec3c3c3c3c366666666663c3c1818740aa266d45e1274ffffc0c0c0c0ffffc0c0c0c0ffff6a016b046c0e6d00a28112a680ffffffffffffffffff00e064006500d45874084440229e452012a412906400750800ee12ae600fe09e12a8128a4a0122d04a02238a4a0323b84a0423e04a0524184a0624784a0724e64a0825101318a28164026502d458650ad4586512d458640a6505d4536412d453641ad4536422d453642ad4536432d453a2fe130afcfcfcfcfcfcfcfcfcfcfcfc75037402d45c74067509d45300eea280dbc14f0113726002e0a16d026004e0a16d046006e0a16d066008e0a16d08dbc14d027cff4d047bff4d067b014d087c014b40135e4bff13646002f015f0073000135613187a014a09153a6b01a281128a7aff6b3ea281128a6003f018600fe09e13786a016b046c0e6d00a28100e0128a64006511a281d4537408d453740875ffd453740875ffd4537408d4537408d45374087501d45374087501d45300ee64006511a281d4537408d45374087502d4527408d4517408d4517408d4517408d4517408d45100ee64006513a281d451a2807408d4517501d4517501a281d4517408d4517408d452740875ffd4537408d454740875ffd456740875ffd45800ee64006512a281d4587408d4587408d4587408d4587408d4587408d4587408d458a28075ff7420d45175ffd45175ffd45175ffd45175ffd45175ffd45175ffd45175ffd45175ffa281d4517408d4517408d4517408d4517408d4517408d45100ee64006509a281d4517408d4517408d4517408d4517408d4517408d451a2807501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501d4517501a281d4517408d4517408d45100ee6400651aa281d4517408d4517408d4517408d4517408d45175ffd4517408d4517408d4517408d45100ee64006519a281d4517408d4517408d4517408d4517408d45175ffd4517408d4517408d4517408d45100ee00e067036803a544155caeaaea4a4e00a4a4a4a5e2005d5555559d00c84848404800d785a54a7708d7857708a550d7857708a556d7851570"];D=[];for(i in d){D[i]=[];for(j in d[i]){D[i].push("0x"+d[i].substr(j*2,2)|0);j++}}</script><br>Demo:<br><button onclick=P(D[1])>Rocket2<button onclick=P(D[2])>Breakout<button onclick=P(D[3])>X-mirror</button><br><button onclick=P(D[4])>Cave<button onclick=P(D[5])>Soccer<button onclick=P(D[0])>;)<button onclick="top.location='//goo.gl/VeNoVs'">All ROMs

6.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<canvas id=a width=615 height=470><script>c=a.getContext`2d`;c.scale(a.height/1E3,a.height/1E3);d=e=f=h=0;g=[];for(o=0;1E3>o;o++)g[o]=g[o+1E3]=8*Math.random()|0;i=j=300;k=20;l=50;ontouchstart=onmousedown=function(){if(e){d=e=f=h=0;g=[];for(o=0;1E3>o;o++)g[o]=g[o+1E3]=8*Math.random()|0;i=j=300;k=20;l=50}else h=45,d=1};(n=function(){c.fillStyle="#E50";c.fillRect(0,0,4E4,4E4);c.fillStyle="#920";c.beginPath();c.moveTo(-k,0);for(o=2E3;o--;)o%20?c.lineTo(40*o-k,20+4*g[o]):(c.lineTo(40*o-k,100*g[o]),c.lineTo(40*o-k-4,100*g[o]));c.lineTo(40*o-k,0);c.fill();c.beginPath();c.moveTo(-k,2E3);for(o=2E3;o--;)o%20?c.lineTo(40*o-k,980-4*g[o]):(c.lineTo(40*o-k,100*(g[o]+3)),c.lineTo(40*o-k-4,100*(g[o]+3)));c.lineTo(40*o-k,1E3);c.fill();p="fEFf& {{~_=,;=vviJ.jfVi/.OoyizyhkhEwf74)\n$fwwuvtU`"+(10<h?"iZ[*)yj:*im**y|Ktdww54#5Dy\iz[Kzi[Jiijk[e@1!":"zl]LfU{\lKtBUh{zzU66iigig5\n&iiyz{vfwwiyDfwiiE");c.fillStyle="#000";c.beginPath();c.moveTo(v=i-e,w=(j-=h)-e);for(o in p)y=8-2*(p.charCodeAt(o)>>4),z=16-2*(p.charCodeAt(o)&15),c.lineTo(v+=e?y:z,w+=e?-z:y);c.fill();d&&(h-=6);d&&!e&&(k+=20,4E4<k&&(k-=4E4));!d||e||(k+280)%800||(f++,20<l&&l--);if(50>j||950<j||!((k+300)%800)&&(j<100*g[20*~~(k/800)+20]+50||j>100*g[20*~~(k/800)+20]+250))e=40;c.fillStyle="#fff";c.font="6em Arial";d&&c.fillText(f,a.width/(a.height/1E3)/2,500);d||c.fillText("#FloppyDragon",a.width/(a.height/1E3)/2-300,500);e&&c.fillText("score",a.width/(a.height/1E3)/2-80,400);c.fillText(e?"restart":d?"":"start",a.width/(a.height/1E3)/2-100,600);setTimeout(n,l)})()</script>
1+
<canvas id=a width=615 height=470><script>c=a.getContext`2d`;c.scale(a.height/1E3,a.height/1E3);d=e=f=h=0;g=[];for(o=0;1E3>o;o++)g[o]=g[o+1E3]=8*Math.random()|0;i=j=300;k=20;l=50;ontouchstart=onmousedown=()=>{if(e){d=e=f=h=0;g=[];for(o=0;1E3>o;o++)g[o]=g[o+1E3]=8*Math.random()|0;i=j=300;k=20;l=50}else h=45,d=1};(n=()=>{c.fillStyle="#E50";c.fillRect(0,0,4E4,4E4);c.fillStyle="#920";c.beginPath();c.moveTo(-k,0);for(o=2E3;o--;)o%20?c.lineTo(40*o-k,20+4*g[o]):(c.lineTo(40*o-k,100*g[o]),c.lineTo(40*o-k-4,100*g[o]));c.lineTo(40*o-k,0);c.fill();c.beginPath();c.moveTo(-k,2E3);for(o=2E3;o--;)o%20?c.lineTo(40*o-k,980-4*g[o]):(c.lineTo(40*o-k,100*(g[o]+3)),c.lineTo(40*o-k-4,100*(g[o]+3)));c.lineTo(40*o-k,1E3);c.fill();p="fEFf& {{~_=,;=vviJ.jfVi/.OoyizyhkhEwf74)\n$fwwuvtU`"+(10<h?"iZ[*)yj:*im**y|Ktdww54#5Dy\iz[Kzi[Jiijk[e@1!":"zl]LfU{\lKtBUh{zzU66iigig5\n&iiyz{vfwwiyDfwiiE");c.fillStyle="#000";c.beginPath();c.moveTo(v=i-e,w=(j-=h)-e);for(o in p)y=8-2*(p.charCodeAt(o)>>4),z=16-2*(p.charCodeAt(o)&15),c.lineTo(v+=e?y:z,w+=e?-z:y);c.fill();d&&(h-=6);d&&!e&&(k+=20,4E4<k&&(k-=4E4));!d||e||(k+280)%800||(f++,20<l&&l--);if(50>j||950<j||!((k+300)%800)&&(j<100*g[20*~~(k/800)+20]+50||j>100*g[20*~~(k/800)+20]+250))e=40;c.fillStyle="#fff";c.font="6em Arial";d&&c.fillText(f,a.width/(a.height/1E3)/2,500);d||c.fillText("#FloppyDragon",a.width/(a.height/1E3)/2-300,500);e&&c.fillText("score",a.width/(a.height/1E3)/2-80,400);c.fillText(e?"restart":d?"":"start",a.width/(a.height/1E3)/2-100,600);setTimeout(n,l)})()</script>

7.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<meta charset=utf-8><script>for(i=g=b=[c=""];d=e=f=g;onkeyup=a=>d+=a.which-39)c+=" "+"⡆⡅⡃⠇"[b[i++]=(g=7*++g%97)%4];setInterval('e<4||e%27?i:i&&b[g++]==d?f++:i=0;top.location.hash=i?["⠈⠐⠠⢀"[d]]+c.slice(e++/9):f',27)</script>
1+
<meta charset=utf-8><script>for(i=g=b=[c=""];d=e=f=g;onkeyup=a=>d+=a.which-39)c+=" "+"⡆⡅⡃⠇"[b[i++]=(g=7*++g%97)%4];setInterval`e<4||e%27?i:i&&b[g++]==d?f++:i=0${27}top.location.hash=i?["⠈⠐⠠⢀"[d]]+c.slice(e++/9):f`</script>

8.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<table border id=t><script>g=n=c=1;for(m=h=[],i=20;i;)h+=(i--&3?"":"<tr>")+"<th id=t"+i+" width=20 onclick=g&&(this[H]^c?g=0:m[this[H]='\xa0',m.indexOf(c++)]=0)>\xa0";t[H='innerHTML']=h;setInterval(function(y){if(!g)t[H]=c-1;if(g)if(n<c+20){for(;!y;)if(!m[k=20*Math.random()|0])y=m[k]=this["t"+k][H]=n++}else g=0},500)</script>
1+
<table border id=t><script>g=n=c=1;for(m=h=[],i=20;i;)h+=(i--&3?"":"<tr>")+"<th id=t"+i+" width=20 onclick=g&&(this[H]^c?g=0:m[this[H]='\xa0',m.indexOf(c++)]=0)>\xa0";t[H='innerHTML']=h;setInterval(y=>{if(!g)t[H]=c-1;if(g)if(n<c+20){for(;!y;)if(!m[k=20*Math.random()|0])y=m[k]=this["t"+k][H]=n++}else g=0},500)</script>

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Js13kGamePak
2+
==
3+
4+
A compilation of 26+ mini JS games made by the Codegolf Team between 2013 and 2016
5+
6+
Play here: http://codegolf.github.io/js13kGamePak
7+
8+
Plus a few chip8 ROMs. You can download all the free chip8 ROMs here: http://codegolf.github.io/js13kGamePak/ROM.zip
9+
10+
The source code of the js13k chip8 ROM can be found here: https://github.com/codegolf/js13kGamePak/tree/gh-pages/src/js13k_c8_source.txt

src/ROM.zip renamed to ROM.zip

File renamed without changes.

0 commit comments

Comments
 (0)