forked from flash6083/HacktoberFest-GUI-Projects-and-Games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
36 lines (27 loc) · 838 Bytes
/
script.js
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
window.addEventListener('load', () => {
//program enters from this door
initActions()
})
function newGame(_boardSize, _level) {
boardSize = _boardSize;
boxSize = parseInt(Math.sqrt(boardSize))
level = _level;
board = new Board(boardSize);
isBoardValidate = board.createBoard(boardSize);
console.log('isBoardValidate', isBoardValidate)
//dig holes
solvedBoard = copyBoard(board.board)
digger = new Digger(level, board.board, boardSize)
questionBoard = copyBoard(board.board)
//draw grid on DOM
view = new View()
view.createBoardHTML(boardSize)
view.printBoard(questionBoard)
initActions()
//solver
//solver = new Solver(board.board)
}
function clearUserInput(){
board.board = copyBoard(questionBoard)
view.printBoard(questionBoard)
}