- Author:
- The Codegolf team
- Twitter:
- @
- GitHub:
- codegolf
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- Compo:
- pure
- Demo link:
- https://js1k.com/2015-hypetrain/demo/2145
- Shortlink:
- https://js1k.com/2145
- Blog post:
- please update here!
- Bytes:
- 1022
- Chars:
- 1022
- Submission
for(_='()$%4!){Kfor(JJi=P","O="Nc+N<tonbuttwidthD%2*200);--.join(AAABAAheight1)&&(=functi(aK>\\xa0"Games #B[N5emkeyup.innerHTML= setTimeout(A>MiniMath.random$> <a href=/21border< click=z( target=_blank;C.style.(zhKb "<ft face=arial><center><p2<p>0)Sim2048</1</a21Apps</a><div id=C>";if(hKdif(a)return(1<D?4-a:a-<<|i-i!>>;PH|*H;i%H];i%H]=2<<+.1},ePH=16;i;G|=p>>1p=m=d(j=i!+],jE=n=d(j)])p-E||(c=a?0:p?S+=m]*=2:i++,m]=E,n]=void 0))};(D=a?a.which-37:B=[];D>>2||e$|d(a?c:d$JD=c=4;D;)e(;Jc=S+"<table >";H;C h =50 =50+[H]])H!?0:r})(S=G=0)}else{cKPg=f.push(new Date!j=i;a,dKZ=["FOFF0OFO080"];~anew Audio((BNdata:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAEAQB8AAEAfgAZGF0YU")+Array(Z[(3+a)!]=333)B.slice(60+2*a)))).play(,250,-)ColorN#"+Z"#"da^f[j]?alert(g):++j^g||c$)},5*i,f[i])};c(f=[]A(a.keyCode-37,}backgroundN#0"""RadiusN55em" solid"}})$';g=/[-N-PJK!$]/.exec(_);)with(_.split(g))_=join(shift());eval(_)
- Description
- Two mini JS games: Simon and 2048!
Authors and contributors: Xem (@MaximeEuziere), Veu, @subzey, @p01, @aemkei, @mathias
MINISIMON
a Simon game with sound in ~ 499b
Inspired by: http://xem.github.io/minisimon/
Rules:
- Remember the sound & light sequence played by the game
- Reproduce this sequence using the arrow keys of your keyboard
- The sequence gets longer and longer - You lose if you make a mistake
- Tweet your high score! #MiniSimon
- Pro-tip: you can continue playing after a mistake
MINI2048
A 2048 clone in ~ 491b
Inspired by https://gist.github.com/veu/603535c10c8516de15cb
(original version keeps high scores in LocalStorage. We removed this feature to fit js1k15 rules)
Rules:
- Use your arrow keys to gather the bumbers on one side of the board and gather the numbers that are equal
- You win if you manage to reach the number 2048
- You lose if the grid is full and you can't do any move
- Tweet your high score! #Mini2048
Golfed by hand and with <3
Packed with RegPack
Cheers, The Codegolf Team
- Base64 encoded
Zm9yKF89JygpJCU0ISl7S2ZvcihKSmk9UCIsIk89Ik5jK048dB9vbh5idXR0Hh13aWR0aBxEJTIqMhswMBopOxktLRguam9pbigXQUFBQkFBFmhlaWdodBUxKRQmJigTPWZ1bmN0aR4oEhJhSxE+XFx4YTAiEEdhbWVzICMPQlsOTjVlbQwea2V5dXARCy5pbm5lckhUTUw9CXNldFRpbWVvdXQoQQg+TWluaQdNYXRoLnJhbmRvbSQGPiA8YSBocmVmPS8yMQVib3JkZXIEPB0gHmNsaWNrPXooAyB0YXJnZXQ9X2JsYW5rBwI7Qy5zdHlsZS4BKHoSaEtiCSI8Zh50IGZhY2U9YXJpYWw+PGNlbnRlcj48cAcPMjxwPgMwKQdTaW0eAxQHMjA0ODwvHQUaAg8xPC9hBTIxAkFwcHM8L2E+PGRpdiBpZD1DPiI7aWYoaEtkEWlmKGEpcmV0dXJuKDE8RD80LWE6YS0UPDwbfGktaSE+Phs7UEh8BipIOw4YaSVIXTsZDmklSF09Mjw8BisuMX0sZRFQSD0xNjtpGDtHfD1wPj4xFHA9Dm09ZChqPWkhKxRdLBhqE0U9Dm49ZChqKV0pE3AtRXx8KGM9YT8wOg5wP1MrPQ5tXSo9MjoOaSsrLG1dPUUsbl09dm9pZCAwKSl9OygLRD1hP2Eud2hpY2gtMzc6Qj1bXTtEPj4yfHxlJHxkKGE/YzpkJBlKRD1jPTQ7RBg7KWUoFDtKYz1TKyI8dGFibGUgBD4iO0g7QwkfaCAcPTUwIBU9NTAQK1sOSF1dKUgYIT8wOh9yEH0pKFM9Rz0wKX1lbHNle2MSS1BnPWYucHVzaChuZXcgRGF0ZSEZaj1pOwgSYSxkS1o9WyIaRk9GRjBPRhpPMDgwIl07fmETbmV3IEF1ZGlvKChCTmRhdGE6YXVkaW8vd2F2O2Jhc2U2NCxVa2xHUmw5dlQxOVhRVlpGWm0xMElCQUEWRUFRQjhBQUVBZhZnQVpHRjBZVSIpK0FycmF5KFpbKDMrYSkhXT0zMzMpF0Iuc2xpY2UoNjArMiphKSkpKS5wbGF5KAgsMjUwLC0UKQEEQ29sb3JOIyIrWhciIyIZZBNhXmZbal0/YWxlcnQoZyk6KytqXmd8fGMkKX0sNRoqaRgsZltpXSkZfTtjKGY9W10ZC0EoYS5rZXlDb2RlLTM3LBR9AWJhY2tncm91bmROIxowIgEcDCIBFQwiAQRSYWRpdXNONTVlbSIBBAwgc29saWQifX0pJCc7Zz0vWwEtH04tUEpLISRdLy5leGVjKF8pOyl3aXRoKF8uc3BsaXQoZykpXz1qb2luKHNoaWZ0KCkpO2V2YWwoXyk=
- Original source
function z(a){
// UI
b.innerHTML = "<font face=arial><center><p><b>MiniGames #2<p><button onclick=z(0)>MiniSimon<button onclick=z(1)>Mini2048</button> <a href=/2100 target=_blank>MiniGames #1</a> <a href=/2121 target=_blank>MiniApps</a><div id=P>";
// 2048
if(a){
function M(c,d){for(i=H=16;i--;G|=p>>11)for(p=B[m=V(j=i%4+1)];--j?(q=B[n=V(j)])?p-q?0:h=c?0:B[p?S+=B[m]*=2:B[i++,m]=q,n]=d:0:0;);}
function V(x){if(x)return(D>1?4-x:x-1)<<D%2*2|i-i%4>>D%2*2;for(i=H|Math.random()*H;B[--i%H];);B[i%H]=2<<Math.random()+.1}
(onkeyup=function(e){D=e?e.which-37:B=[];D>>2||M()|V(e?h:V());for(D=h=4;D--;)M(1);for(h=(G|h?S:S)+"<table border>";H;P.innerHTML=h+="<th width=50 height=50>\xa0"+[B[H]])H--%4?0:h+="<tr>\xa0"})(S=G=0)
}
// Simon
else{
function h(){for(i=g=f.push(new Date%4);j=i;setTimeout(A=function(k,q){Z=["00F","FF0","F00","080"];~k&&new Audio((B="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU")+Array(Z[(3+k)%4]=333).join(B.slice(60+k*2))).play(setTimeout(A,250,-1));P.style.borderColor="#"+Z.join("#");if(q)k^f[j]?alert(g):++j^g||h()},500*i--,f[i]));}
h(f=[]);
onkeyup=function(e){A(e.keyCode-37,1)}
P.style.background="#000";
P.style.width="5em";
P.style.height="5em";
P.style.borderRadius="55em";
P.style.border="5em solid";
}
}z()