< !DOCTYPE html>
< html xmlns="http:///1999/xhtml">
< head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/JAVAscript">
var data = new Array(27);
var canvas;
var context;
var time = 0;
var random = new Array(5);//Custom two-dimensional out-of-order table
random[0] = [5, 2, 8, 7, 1, 3, 4, 6, 0];
random[1] = [2, 5, 8, 0, 4, 6, 3, 7, 1];
random[2] = [6, 7, 2, 8, 0, 1, 5, 3, 4];
random[3] = [2, 1, 6, 3, 5, 4, 7, 0, 8];
random[4] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
function start() {
var guess = new Array();
var count = 0;
while (count < 27) {//Generate random 27 cards
var temp = parseInt(() * 54) + 1;
for (var i = 0; i < count + 1; i++) {
if (temp == guess) {//If you repeat it, don't
temp = 100;
break;
}
}
if (temp != 100) {
guess[count] = temp;
data[count] = new Image();
data[count].src = "images/" + temp + ".gif";
count++;
}
}
}
function draw() {
canvas = ("canvas");
context = ("2d");
var temp1 = parseInt(() * 5);
var temp2 = parseInt(() * 5);
var temp3 = parseInt(() * 5);
for (var i = 0; i < 9; i++) {//Indisorder sorting method
(data[random[temp1] * 3 + 0], 20, i * 30 + 40);
(data[random[temp2]* 3 + 1], 20 + 100, i * 30 + 40);
(data[random[temp3]* 3 + 2], 20 + 200, i * 30 + 40);
}
}
function play(index) {
if (time >= 3)
alert("Please click again");
for (var i = 0; i < (3 - time) * 3; i++) {
var temp = data;
data= data[i * 3 + index - 1];
data[i * 3 + index - 1] = temp;
}
time++;
if (time >= 3) {
(data[0], 400, 50);
return;
}
draw();
}
start();
</script>
<style type="text/css">
input {
margin-right: 60px;
}
</style>
< /head>
< body>
<p>
Let me guess the card in your heart<br />
First select a card in your mind from the list, remember it, then select the column it is in, click three times and I will guess the card in your mind. <br />
Come and try it, I understand you! <br />
If you encounter a card that cannot be displayed or it is incomplete, please refresh. If your browser does not support HTML5, please change the browser, such as chrome, Firefox, etc.
</p>
<canvas width="700" height="400" >Your browser does not support HTML5, please change the browser, such as chrome, Firefox, etc.</canvas>
<br />
<input type="button" value="first column" />
<input type="button" value="second column" />
<input type="button" value="third column" />
<input type="button" value="Another time" />
< /body>
< /html>