Last active
February 18, 2021 00:34
-
-
Save dsasse07/3df50bdb9810e2cfc9f51bd812433491 to your computer and use it in GitHub Desktop.
Sudoku safe placement in column check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// puzzleArray is the game board being solved. A 9x9 matrix | |
// emptyCell = {rowIndex: INT , colIndex: INT } INT = coordinates of currently empty cell | |
// num = integer value 1-9 being tested | |
const colSafe = (puzzleArray, emptyCell, num) => { | |
return !puzzleArray.some(row => row[ emptyCell.colIndex ] == num ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment