mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 02:05:08 +08:00
Add proper test to Backtracking/Sudoku
This replaces the "main" test in the implementation file.
This commit is contained in:
@ -72,26 +72,4 @@ class Sudoku {
|
||||
}
|
||||
}
|
||||
|
||||
function main () {
|
||||
// main function with an example
|
||||
const sudokuBoard = new Sudoku([
|
||||
[3, 0, 6, 5, 0, 8, 4, 0, 0],
|
||||
[5, 2, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 8, 7, 0, 0, 0, 0, 3, 1],
|
||||
[0, 0, 3, 0, 1, 0, 0, 8, 0],
|
||||
[9, 0, 0, 8, 6, 3, 0, 0, 5],
|
||||
[0, 5, 0, 0, 9, 0, 6, 0, 0],
|
||||
[1, 3, 0, 0, 0, 0, 2, 5, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 7, 4],
|
||||
[0, 0, 5, 2, 0, 6, 3, 0, 0]
|
||||
])
|
||||
|
||||
sudokuBoard.printBoard()
|
||||
|
||||
console.log('\n')
|
||||
sudokuBoard.solve()
|
||||
|
||||
sudokuBoard.printBoard()
|
||||
}
|
||||
|
||||
main()
|
||||
export { Sudoku }
|
||||
|
Reference in New Issue
Block a user