-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathta.html
More file actions
32 lines (30 loc) · 883 Bytes
/
ta.html
File metadata and controls
32 lines (30 loc) · 883 Bytes
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
<!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">
// write your code here
var heap = [];
var type = ["黑桃", "愛心", "方塊", "梅花"];
var num = ["A", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"];
for(i in type) {
for(j in num) {
heap.push((type[i] + num[j]));
}
}
for (var i = heap.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = heap[i];
heap[i] = heap[j];
heap[j] = temp;
}
console.log(heap);
</script>
</body>
</html>