<! DOCTYPE HTML Public"-//W3C//DTD XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD">"http://www.w3.org/1999/xhtml">"Content-type"Content="text/html; Charset=utf-8"/><title> Untitled Document </title><script type="Text/javascript">varnow=-1;varlast=-1;varCount=0;varx=0;varA= -;varN;n= (Row*col)/2;varrow=3, col=4;varIsused=NewArray;varmyarray=NewArray ( -); function Mysort () {returnMath.random ();.5;} function init (row, col) {n= (Row*col)/2; for(vark=0; k<n;k++) {Myarray[k]= (Math.Round (math.random () * -)+1); Myarray[k+n]=Myarray[k]; } for(vark=0;k<2*n;k++) {Isused[k]=false; } myarray.sort (Mysort); varStr='<table name= "MyT" border= "0" width= "height=" >'; for(varI=1; i<=row;i++) {str+="<tr>"; for(varj=0; j<col;j++) {str+="<td onclick= ' Judge ("+ ((I-1) *col +j) +"); ' >"Str+=""+ ((I-1) *col +j) +"' src= ' photo/image0.gif '/>"Str+="</td>"; } STR+="</tr>"; } STR+="</table>"document.getElementById ("MT"). innerhtml=str;} function CreateTable () {varRow=document.getelementbyid ("T1"). Value; varCol=document.getelementbyid ("T2"). Value; Init (row,col);} Function Judge (temp) {n= (Row*col)/2; if(Isused[temp])return; Isused[temp]=true; Last=Now ; now=temp; varCurrimg=document.getelementbyid ("Img_"+temp); CURRIMG.SRC="Photo/image"+myarray[temp]+". gif"; if(last>=0) { if(myarray[now]==Myarray[last]) { Last=-1; now=-1; Count++; if(count==N) {++x; if(x>2) {alert ("Game Over"); varStr="your game score is:"+A; document.getElementById ("MT"). innerhtml=str; } Else{Count=0; Alert ("game win, go to the next level"); returnInit (++row,++col); } } } Else{a--; Currimg=document.getelementbyid ("Img_"+Last ); CURRIMG.SRC="Photo/image0.gif"; Isused[last]=false; } } }</script>"MT"style="Background:url (photo/10.jpg)">"MT"> Card Memory Game </div>"text"Value="3"Id="T1"/><input type="text"Value="4"Id="T2"/><input type="Button"Value="Start the game"onclick="createtable ();"/></body>Half biennial HTML5 mini game production