»
Tiếng AnhTiếng PhápTiếng Việt

In - Đọc trí nhớ - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Trò chơi » Giải đố » Đọc trí nhớ
URL: https://www.javascriptbank.com/mind-reader-2.html

Đọc trí nhớ © JavaScriptBank.comLuật chơi: những số thì được sắp xếp trng ba nhóm, nghĩ trong đầu bạn một số từ 1 đến 21, tìm số đó thuộc nhóm nào và nhấn vào nút của nhóm đó. Thực hiện ba lần thì trò chơi JavaScript sẽ đưa ra số bạn đang nghĩ trong đầu.

Phiên bản đầy đủ: jsB@nk » Trò chơi » Giải đố » Đọc trí nhớ
URL: https://www.javascriptbank.com/mind-reader-2.html



JavaScript
<script language="javascript">var ar1=new Array(),ar2=new Array(),ar3=new Array(),ar=new Array()var nam=new Array(),pos=new Array()var itemclicked,buttonclicked,x,j,i,flagflag=0function start1() {flag=1x=1itemclicked=0buttonclicked=0for(var i=1;i<22;i++){ar[i]=ipos[i]=i}nam[1]=L1.style;nam[2]=L2.style;nam[3]=L3.style;nam[4]=L4.stylenam[5]=L5.style;nam[6]=L6.style;nam[7]=L7.style;nam[8]=L8.stylenam[9]=L9.style;nam[10]=L10.style;nam[11]=L11.style;nam[12]=L12.stylenam[13]=L13.style;nam[14]=L14.style;nam[15]=L15.stylenam[16]=L16.style;nam[17]=L17.style;nam[18]=L18.stylenam[19]=L19.style;nam[20]=L20.style;nam[21]=L21.stylefor(i=1;i<8;i++){ar1[i]=i}x=1for(i=8;i<15;i++){ar2[x]=ix=x+1}x=1for(i=15;i<22;i++){ar3[x]=ix=x+1}nam[1].top=155nam[1].left=15nam[2].top=155nam[2].left=45nam[3].top=155nam[3].left=75nam[4].top=155nam[4].left=105nam[5].top=200nam[5].left=15nam[6].top=200nam[6].left=45nam[7].top=200nam[7].left=75nam[8].top=155nam[8].left=155nam[9].top=155nam[9].left=185nam[10].top=155nam[10].left=215nam[11].top=155nam[11].left=245nam[12].top=200nam[12].left=155nam[13].top=200nam[13].left=185nam[14].top=200nam[14].left=215nam[15].top=155nam[15].left=305nam[16].top=155nam[16].left=335nam[17].top=155nam[17].left=365nam[18].top=155nam[18].left=395nam[19].top=200nam[19].left=305nam[20].top=200nam[20].left=335nam[21].top=200nam[21].left=365alert("Select a number from 1 to 21..   Keep it in your Mind")alert("Numbers are displayed here in three groups .. along with a button")alert("Find out your number and click the button along with that group")}function cal1(b){if(flag==0){alert("Plase Click the Button to Try Mind Reader ")}else{itemclicked=itemclicked+1buttonclicked=bif(buttonclicked==1){j = 1                for(i=1;i<8;i++){        ar[j]=ar2[i]        j=j+1        }                for(i=1;i<8;i++){        ar[j] = ar1[i]        j=j+1        }                for(i=1;i<8;i++)        {ar[j] = ar3[i]        j=j+1        }}if(buttonclicked==2){j = 1                for(i=1;i<8;i++){        ar[j]=ar1[i]        j=j+1        }                for(i=1;i<8;i++){        ar[j] = ar2[i]        j=j+1        }                for(i=1;i<8;i++)        {ar[j] = ar3[i]        j=j+1        }}if(buttonclicked==3){j = 1                for(i=1;i<8;i++){        ar[j]=ar1[i]        j=j+1        }                for(i=1;i<8;i++){        ar[j] = ar3[i]        j=j+1        }                for(i=1;i<8;i++)        {ar[j] = ar2[i]        j=j+1        }}j=1for(i=1;i<8;i++){ar1[i]=ar[j]j=j+1ar2[i]=ar[j]j=j+1ar3[i]=ar[j]j=j+1}nam[ar1[1]].top=155nam[ar1[1]].left=15nam[ar1[2]].top=155nam[ar1[2]].left=45nam[ar1[3]].top=155nam[ar1[3]].left=75nam[ar1[4]].top=155nam[ar1[4]].left=105nam[ar1[5]].top=200nam[ar1[5]].left=15nam[ar1[6]].top=200nam[ar1[6]].left=45nam[ar1[7]].top=200nam[ar1[7]].left=75nam[ar2[1]].top=155nam[ar2[1]].left=155nam[ar2[2]].top=155nam[ar2[2]].left=185nam[ar2[3]].top=155nam[ar2[3]].left=215nam[ar2[4]].top=155nam[ar2[4]].left=245nam[ar2[5]].top=200nam[ar2[5]].left=155nam[ar2[6]].top=200nam[ar2[6]].left=185nam[ar2[7]].top=200nam[ar2[7]].left=215nam[ar3[1]].top=155nam[ar3[1]].left=305nam[ar3[2]].top=155nam[ar3[2]].left=335nam[ar3[3]].top=155nam[ar3[3]].left=365nam[ar3[4]].top=155nam[ar3[4]].left=395nam[ar3[5]].top=200nam[ar3[5]].left=305nam[ar3[6]].top=200nam[ar3[6]].left=335nam[ar3[7]].top=200nam[ar3[7]].left=365if(itemclicked==1){alert("Now the numbers will be shuffled.... click the button of the group in which your number comes")}if(itemclicked==2){alert("Again the numbers will be shuffled... click the button of the group in which your number comes")}if(itemclicked==3){alert("Now I'm going to read your mind")alert("Your number is "+ar[11])alert("Click Try Mind Reader Button to Play Again")flag=0}}}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form name=frm1><DIV ID="ms" STYLE="position:relative; text-align: center; width: 100%;height:5px;"><h1>Mind Reader</h1> @ johns221b.50megs.com</DIV><DIV ID="L1" STYLE="position:absolute; left:15px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>1</center></DIV><DIV ID="L2" STYLE="position:absolute; left:45px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>2</center></DIV><DIV ID="L3" STYLE="position:absolute; left:75px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>3</center></DIV><DIV ID="L4" STYLE="position:absolute; left:105px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>4</center></DIV><DIV ID="L5" STYLE="position:absolute; left:15px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>5</center></DIV><DIV ID="L6" STYLE="position:absolute; left:45px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>6</center></DIV><DIV ID="L7" STYLE="position:absolute; left:75px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>7</center></DIV><DIV ID="c1" STYLE="position:absolute; left:105px; top:200px; width:25px; height:25px; background-color:pink;"><br><b><center><input type=button name=b1 onClick="cal1(1)"></center></DIV><DIV ID="L8" STYLE="position:absolute; left:155px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>8</center></DIV><DIV ID="L9" STYLE="position:absolute; left:185px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>9</center></DIV><DIV ID="L10" STYLE="position:absolute; left:215px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>10</center></DIV><DIV ID="L11" STYLE="position:absolute; left:245px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>11</center></DIV><DIV ID="L12" STYLE="position:absolute; left:155px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>12</center></DIV><DIV ID="L13" STYLE="position:absolute; left:185px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>13</center></DIV><DIV ID="L14" STYLE="position:absolute; left:215px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>14</center></DIV><DIV ID="c2" STYLE="position:absolute; left:245px; top:200px; width:25px; height:25px; background-color:pink;"><br><b><center><input type=button name=b2 onClick="cal1(2)"></center></DIV><DIV ID="L15" STYLE="position:absolute; left:305px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>15</center></DIV><DIV ID="L16" STYLE="position:absolute; left:335px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>16</center></DIV><DIV ID="L17" STYLE="position:absolute; left:365px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>17</center></DIV><DIV ID="L18" STYLE="position:absolute; left:395px; top:155px; width:25px; height:25px; background-color:green;"><br><b><center>18</center></DIV><DIV ID="L19" STYLE="position:absolute; left:305px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>19</center></DIV><DIV ID="L20" STYLE="position:absolute; left:335px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>20</center></DIV><DIV ID="L21" STYLE="position:absolute; left:365px; top:200px; width:25px; height:25px; background-color:green;"><br><b><center>21</center></DIV><DIV ID="c3" STYLE="position:absolute; left:395px; top:200px; width:25px; height:25px; background-color:pink;"><br><b><center><input type=button name=b3 onClick="cal1(3)"></center></DIV><DIV ID="ch" STYLE="position:absolute; left:100px; top:250px; width:500px; height:150px; background-color:#FFFFCC;"><br><b><font color=purple><u>How to play??</u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=button value=" Try Mind Reader ..... " name=trybtn onClick="start1()"><br></u><font size=2 color=black>1.<font size=2 color=red> <i>Select a number between 1 and 21 in your mind.</i><font size=2 color=black><br>2. <i><font size=2 color=red>The numbers are arranged here in 3 groups.</i><font size=2 color=black><br>3. <i><font size=2 color=red>For each group there is a button for selecting purpose.</i><font size=2 color=black><br>4. <i><font size=2 color=red>Find out your number and click the button along with that group.</i><font size=2 color=black><br>5. <i><font size=2 color=red>Follow instructions ......</i><br><a href="http://www.JavaScriptBank.com">www.JavaScriptB@nk.com</a></DIV></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->