MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / findEmptyCell

Method findEmptyCell

Backtracking/Sudoku.js:7–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5 }
6
7 findEmptyCell() {
8 // Find a empty cell in the board (returns [-1, -1] if all cells are filled)
9 for (let i = 0; i < 9; i++) {
10 for (let j = 0; j < 9; j++) {
11 if (this.board[i][j] === 0) return [i, j]
12 }
13 }
14 return [-1, -1]
15 }
16
17 check([y, x], value) {
18 // checks if the value to be added in the board is an acceptable value for the cell

Callers 2

solveMethod · 0.95
Sudoku.test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected