This game will test you about the Periodic Table - UP or DOWN key or tap top or bottom canvas to play.
for(_='0,,w/2,c.fillStyle="#0f=function=(d){=Math.5,Rect(",w-f,1>k?),-2);#FFF";w-e+m*w50 *h()|0)+2*(59)d.keyCode&&(===00Text(,3var b=u=1 ,e=w=5,-4,g=hrandom,k,l,m,n; p(d,r){"HHeLiBeBCNOFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaWReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaUNpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnUutFlUupLvUusUuo".split(/(?=[A-Z])/)[d],w-f+25*r/2+u/2)} B(){c.font="24px "+(c.textAlign="center"if(f)#0","Game over"uelse{FF";wfor(m=1;5>m;m++)*m/725+20*m/5-33527<(e+=5)e=w<f1>fk=2,l=[(1:0,(0:1],k=26<f?0:f+1,F7 7F4<f?u+(f-4)*[1,-1][k]:u, #0",p(l[0],0p(l[1],14fb<=u- ?g++::b<=u?:g++g25)red"; ,b, , >f?"Z":l[k]+1,7b+32setTimeout(B,16)}}B(window.onkeydown=nd=;(38d||40d)&&>f038d?bmax(b0):40db=2 >b?b+25:b)};a.onclick=d.clientY<u?38:40;n(d)};';G=/[-]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
Zm9yKF89JzAsHSx3LzIsHGMuZmlsbBsbU3R5bGU9IhoaIzAZZj0YZnVuY3Rpb24XPRcoZCl7Fj1NYXRoLhU1LBQbUmVjdCgTIiwTdy1mLBIxPms/ESksEC0yDyk7Dg4aI0ZGRiI7DBN3LWUrbSp3CzUwCSpoKCl8MAgpKzIqKDU5CCkHZC5rZXlDb2RlBiYmKAU9PT0EMDADG1RleHQoAiwzAwF2YXIgYj11PTEJLGU9dz01AywYLTQsZz0daBVyYW5kb20sayxsLG0sbjsXIHAoZCxyKXsC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ZXZhbChfKQ==
// JS1K ENTRY
// Title: Match Atomic Number
// by Muhammad Rifqi Priyo Susanto
// Initialize variables:
var h=300, // height (h) of the canvas;
p=u=h/2, // player position (p) and half height (u) of the canvas;
t=w=500, // position of the clouds (t) and width (w) of the canvas;
o=-4, // position of the bricks and also status of the game (o);
s=0, // score (s);
e = Math.random, // Math.random shortcut (e);
r, // random number and right answer (r);
j, // list of atomic number (j);
i, // for iteration (i).
n; // onkeydown function
// Draw the name of the element at specific position.
function l(z,y){
c.fillText(
// List of elements, split by using capital letter.
"HHeLiBeBCNOFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaWReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaUNpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnUutFlUupLvUusUuo".split(/(?=[A-Z])/)[z]
,w-o+25,y*h/2+u/2);
}
function d(){
// Change behavior.
c.font="24px "+
(c.textAlign="center");
// If game over.
if(-2===o){
// Show score.
c.fillStyle="#000";
c.fillText("Game over",w/2,u);
return;
}else{
// Set the background.
c.fillStyle="#0FF";
c.fillRect(0,0,w,h);
// Draws clouds.
c.fillStyle="#FFF";
for(i=1;i<5;i++)
c.fillRect(w-t+i*w,i*h/5,75,25),
c.fillRect(w-t+i*w+20,i*h/5-5,35,35);
//c.beginPath(),
//c.arc(w-t+i*w,i*h/5,25,0,7),
//c.arc(w-t+i*w+35,i*h/5,35,0,7),
//c.arc(w-t+i*w+70,i*h/5,25,0,7),
//c.fill();
// Check clouds' position.
if((t+=5)>h*9)t=w;
// If not in any game status.
if(o>-2){
// Change elements for each brick.
if(o<1)
r=e()*2|0,
j=[(r<1?1:0)+(e()*59|0)*2,(r<1?0:1)+(e()*59|0)*2],
r=e()*2|0;
// Check bricks' position and game status.
o=o>600?0:o+1;
// Draws bricks.
c.fillStyle="#0F7";
c.fillRect(w-o,0,50,h);
c.fillStyle="#07F";
c.fillRect(w-o,o>400?u+(o-400)*[1,-1][r]:u,50,h);
// Name of the element.
c.fillStyle="#000";
l(j[0],0);
l(j[1],1);
// If player touches the brick:
400===o && (
// If right answer is top brick:
r<1 ?
// If player only touch top brick (no collision):
p<=u-50 ?
s++ // add score
// else
:
o=-2 // indicate game over.
// If right answer is top brick:
:
// If player only touch bottom brick (no collision):
p<=u ?
o=-2 // indicate game over
// else
:
s++ // add score.
);
// Show score.
c.fillText(s,w/2,25);
}
// Draws player into a block with atomic number inside it.
c.fillStyle="red";
c.fillRect(50,p,50,50);
c.fillStyle="#FFF";
c.fillText(o<-2?"Z":(j[r]+1),75,p+32);
}
// Wait 16 ms to redraw. (~60 FPS)
setTimeout(d,16);
}
// Run the game.
d();
// Add handler when key down.
window.onkeydown=n=function(q){q=q.keyCode;
// If UP/DOWN key is down and game hasn't started then start the game.
if((q===38||q===40)&&-2>o)o=0;
// If UP key is down then go up, if DOWN key then go down, else do nothing.
if(q===38)p=Math.max(p-25,0);else if(q===40)p=p<h-50?p+25:p;
};
// Add handler when clicked.
a.onclick=function(q){
// If top half canvas clicked then go up, if bottom half canvas then go down.
q.keyCode=q.clientY<u?38:40;n(q);
};