-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
84 lines (75 loc) · 2.06 KB
/
Copy pathindex.html
File metadata and controls
84 lines (75 loc) · 2.06 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sudoku Solver</title>
<link rel="stylesheet" href="style.css">
<script>
function testGridEasy() {
// Test grid easy
const defaultGrid = [
[7, 8, 0, 4, 0, 0, 1, 2, 0],
[6, 0, 0, 0, 7, 5, 0, 0, 9],
[0, 0, 0, 6, 0, 1, 0, 7, 8],
[0, 0, 7, 0, 4, 0, 2, 6, 0],
[0, 0, 1, 0, 5, 0, 9, 3, 0],
[9, 0, 4, 0, 6, 0, 0, 0, 5],
[0, 7, 0, 3, 0, 0, 0, 1, 2],
[1, 2, 0, 0, 0, 7, 4, 0, 0],
[0, 4, 9, 2, 0, 6, 0, 0, 7]
];
fillGrid(defaultGrid);
}
function testGridHard() {
// Test grid hard
const defaultGrid = [
[0, 0, 0, 3, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 7, 8],
[0, 0, 0, 1, 9, 5, 0, 0, 0],
[6, 0, 0, 0, 0, 0, 9, 0, 0],
[0, 0, 7, 0, 3, 0, 2, 0, 0],
[4, 0, 9, 5, 0, 0, 0, 0, 1],
[0, 9, 1, 0, 2, 8, 0, 0, 7],
[7, 0, 0, 0, 0, 3, 0, 0, 0],
[0, 5, 0, 7, 0, 0, 0, 4, 0]
];
fillGrid(defaultGrid);
}
function testGridImpossible() {
// Test grid impossible
const defaultGrid = [
[5, 1, 6, 8, 4, 9, 7, 3, 2],
[3, 0, 7, 6, 0, 5, 8, 0, 9],
[8, 0, 9, 7, 0, 2, 6, 0, 5],
[1, 3, 5, 0, 6, 0, 9, 8, 7],
[4, 7, 2, 5, 9, 8, 1, 6, 3],
[9, 6, 8, 3, 7, 1, 2, 5, 4],
[2, 5, 3, 1, 8, 6, 4, 9, 0],
[6, 8, 4, 9, 2, 7, 5, 1, 0],
[7, 9, 1, 4, 5, 3, 0, 2, 6]
];
fillGrid(defaultGrid);
}
</script>
</head>
<body>
<div class="sudoku-grid">
<!-- Sudoku grid cells will be generated here -->
</div>
<div class="buttons">
<button onclick="resolveSudoku()">🧠 Resolve</button>
<button onclick="clearSudoku()">🧹 Clear</button>
</div>
<div class="buttons">
<button onclick="testGridEasy()">🧪 Test Grid Easy</button>
<button onclick="testGridHard()">🧪 Test Grid Hard</button>
<button onclick="testGridImpossible()">🧪 Test Grid Impossible</button>
</div>
<script src="sudokusolver.js"></script>
<footer>
Copyright © 2024-2015 PLAIS Lionel<br>
MIT Licence
</footer>
</body>
</html>