Recursive solution to Sudoku generator

后端 未结 6 950
青春惊慌失措
青春惊慌失措 2020-12-19 05:14

I\'m trying to code an algorithm that creates a legal Sudoku board in either Java or Javascript. Neither work, and I\'m not entirely sure why.

Essentially, the prob

6条回答
  •  清歌不尽
    2020-12-19 05:55

    Java:

    Your loop iterator in nextBoard range from 1 to 9. I don't think you meant that. Same in the function legalMove.... initialize cornerX and cornerY to 0.

提交回复
热议问题