dachev / sudoku

Sudoku generator and solver for node.js
146 stars 44 forks source link

0's appearing instead of 9's #9

Closed brian-leighton closed 4 years ago

brian-leighton commented 4 years ago

As the title says. When i make a new puzzle using makepuzzle() I recieve 0's in the place of 9's. Anyway to fix this without looping through the array and replacing 0's with 9's?

dachev commented 4 years ago

Hi @brianL09 . This sounds like a bug. Unfortunately, I don't have much time to maintain this project these days. I'll do my best to fix it but I can't commit to any timeframe. I hope you understand...

dachev commented 4 years ago

Taking a second look, this is not a bug. I agree that it will probably be better to use 1-9 for productivity and readability purposes but that would necessitate internal changes to the entire library. I don't currently have the time for this but I would welcome a PR that comes with a few tests.

brian-leighton commented 4 years ago

Thanks for the quick response, I appreciate it. Totally understand not having the time. I'm still relatively new to javascript, but I'll take a look and see what I can figure out. Otherwise, it should be no problem to just switch the 0's in the puzzles to 9's. Thanks again!

dachev commented 4 years ago

@brianL09 You have to increment all the values by one.

brian-leighton commented 4 years ago

Thanks for the advice!