DEV Community

Discussion on: Generating & Solving Sudoku in JS & Ruby with Backtracking

dsasse07 profile image
Daniel Sasse Author

Thank you! I was able to replicate this using a few different boards after your tip. I wrote a multipleSolutions check that now attempts to solve the puzzle from each of the currently empty positions and if more than one unique solution is found it will replace the removed value and attempt to remove a different one. I believe there is a more efficient solution, but this fix is working in the meantime for our app ( I coded the fix in JS first for the app, and will be working to update the ruby gist and gem to match. Thank you again!