-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyDJ.html
More file actions
58 lines (49 loc) · 1.09 KB
/
MyDJ.html
File metadata and controls
58 lines (49 loc) · 1.09 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
<script>
// var Graph={};
// function Node(x,y,praent){
// this.x=x;
// this.y=y;
// this.parent=parent;
// };
var cols = 7;
var rows = 5;
var grid = new Array(rows);
var type=new Object();
type.one="1";
type.zero="0";
var openSet = [];
var closeSet = [];
function init() {
for (let i = 0; i < rows; i++) {
grid[i] = new Array(cols);
}
for (let i = 0; i < rows; i++) {
for (let j = 0; j < cols; j++) {
grid[i][j] = type.one;
if (i > 0 && i < 4 && j === 3) {
grid[i][j] = type.zero;
}
}
}
}
function print(grid) {
var str = [];
for (let i = 0; i < grid.length; i++) {
str.push(grid[i].join("\t"));
}
str = str.join("\r\n");
console.log(str);
// document.write(str);
}
init();
print(grid);
</script>
</html>