Concentration - Smaller Version
See how fast you match each button pair by remembering their locations.
Click the Timer button below to start a new game whenever you want.
Give the page a few seconds to load the necessary images.
Instructions:
Copy and paste the following javascript in the BODY section of your page wherever you want the gane to appear:
Select all...
<script language="javascript"> var pics=new Array(); for(i=0;i<=8;i++){ pics[i]=new Image(); pics[i].src='image'+i+'.gif'; } var map=new Array(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8) var user=new Array(); var temparray=new Array(); var clickarray=new Array(0,0); var ticker, sec, min, ctr, id=0, oktoclick, finished; function init(){ clearTimeout(id); for(i=0;i<=15;i++)user[i]=0; ticker=0; min=0; sec=0; ctr=0; finished=0; oktoclick=true; document.forms["f"].b.value="Resetting game table..."; scramble(); id=setInterval('runclk()', 995); for(i=0;i<=15;i++){ document.images[('img'+i)].src="image0.gif"; document.images[('img'+i)].alt=""; }} function runclk(){ min=Math.floor(ticker/60); sec=(ticker-(min*60))+''; if(sec.length==1){sec="0"+sec}; ticker++; document.forms["f"].b.value=" "+min+":"+sec+" "; } function scramble(){ for(z=0;z<5;z++){ for(x=0;x<=15;x++){ temparray[0]=Math.floor(Math.random()*16); temparray[1]=map[temparray[0]]; temparray[2]=map[x]; map[x]=temparray[1]; map[temparray[0]]=temparray[2]; }}} function showimage(but){ if(oktoclick){ oktoclick=false; document.images[('img'+but)].src='image'+map[but]+'.gif'; document.images[('img'+but)].alt='Image '+map[but]; if(ctr==0){ ctr++; clickarray[0]=but; oktoclick=true; }else{ clickarray[1]=but; ctr=0; setTimeout('returntoold()', 600); }}} function returntoold(){ if((clickarray[0]==clickarray[1])&&(!user[clickarray[0]])){ document.images[('img'+clickarray[0])].src="image0.gif"; document.images[('img'+clickarray[0])].alt=""; oktoclick=true; }else{ if(map[clickarray[0]]!=map[clickarray[1]]){ if(user[clickarray[0]]==0){ document.images[('img'+clickarray[0])].src="image0.gif"; document.images[('img'+clickarray[0])].alt=""; } if(user[clickarray[1]]==0){ document.images[('img'+clickarray[1])].src="image0.gif"; document.images[('img'+clickarray[1])].alt=""; }} if(map[clickarray[0]]==map[clickarray[1]]){ if(user[clickarray[0]]==0&&user[clickarray[1]]==0)finished++; user[clickarray[0]]=1; user[clickarray[1]]=1; } if(finished>=8){ alert('You did it in '+document.forms["f"].b.value+' !'); init(); }else{ oktoclick=true; }}} var t='
'; for(r=0;r<=3;r++){ t+='
'; for(c=0;c<=3;c++)t+='
'; t+='
'; } t+='
'; document.write(t); window.onload=init; </script>