Skip to content

Instantly share code, notes, and snippets.

@dsasse07
Last active February 18, 2021 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsasse07/3df50bdb9810e2cfc9f51bd812433491 to your computer and use it in GitHub Desktop.
Save dsasse07/3df50bdb9810e2cfc9f51bd812433491 to your computer and use it in GitHub Desktop.
Sudoku safe placement in column check
// 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