Skip to content

Instantly share code, notes, and snippets.

@richardvanbergen
Created October 9, 2018 20:31
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 richardvanbergen/8a083b8e838e9f81d2d62ef67af380ab to your computer and use it in GitHub Desktop.
Save richardvanbergen/8a083b8e838e9f81d2d62ef67af380ab to your computer and use it in GitHub Desktop.
exports.default = complete(grid) => {
// not really necessary but not a negative either, this function can just be init code at the top
createGrid = createGrid() => {}
// again, this function can be init code if you want it to be, not important
identifyMissing = identifyMissing() => {}
// now you don't have to pass around `grid` all the time, your functions aren't as pure but this isn't really
// a functional programming style anyway and it's fine in this instance to be honest
availableRow = availableRow(row, num) => {}
availableCol = availableCol(col, num) => {}
availableSquare = availableSquare(col, row, num) => {}
availableAll = availableAll(col, row, num) => {}
iterateNums = iterateNums(missingNums)
return iterateNums(grid, missingNums)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment