-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathteam_5.html
63 lines (60 loc) · 1.42 KB
/
team_5.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script type="text/javascript">
var pocker = ["黑桃", "紅心", "方塊", "梅花"];
var num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
var pp = new Array(4);
for(i=0; i<4; i++){
pp[i] = new Array(13);
}
for(i=0; i<4; i++)
for(j=0; j<13; j++)
pp[i][j] = 0;
var k = 0;
var l = 0;
var user = new Array(16);
for(i=0; i<8; i++){
do{
l = Math.floor(Math.random()*13);
k = Math.floor(Math.random()*4);
}while(pp[k][l]!=0);
pp[k][l] = 1;
user[i*2] = pocker[k];
user[i*2+1] = num[l];
}
var add = new Array(4);
for(i=0; i<4; i++){
var a, b;
add[i] = user[i*4+1] + user[i*4+3];
}
for(i=0; i<8; i++){
switch(user[i*2+1]){
case 1:
user[i*2+1] = "A";
break;
case 11:
user[i*2+1] = "J";
break;
case 12:
user[i*2+1] = "Q";
break;
case 13:
user[i*2+1] = "K";
break;
}
}
for(i=0; i<4; i++){
var num1, num2;
console.log("User "+i+": ["+user[i*4]+user[i*4+1]+", "+user[i*4+2]+user[i*4+3]+"] "+add[i]+"點");
}
</script>
</body>
</html>