-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathjoou.html
48 lines (46 loc) · 1.21 KB
/
joou.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
<!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 a=["黑桃","梅花","方片","红桃"];
var b=["A",2,3,4,5,6,7,8,9,10,"J","Q","K"];
var c=[];
for(i=1;i<=52;i++)
{
c.push(i);
}
for(i=1;i<=26;i++){
num=Math.round(Math.random()*100);
while(num>=53){
num=Math.round(num/2);
}
temp=c[i];
c[i]=num;
c[num]=temp;
}
console.log(c);
for(i in c)
{
if(c[i]<14){
console.log(a[0],b[c[i]]);
}
else if(c[i]<27 && c[i]>13){
console.log(a[1],b[c[i]-14]);
}
else if(c[i]<40 && c[i]>26){
console.log(a[2],b[c[i]-27]);
}
else{
console.log(a[3],b[c[i]-40]);
}
}
</script>
</body>
</html>