Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a sudoku puzzle #11

Open
jbranchaud opened this issue Dec 18, 2024 · 0 comments
Open

Generate a sudoku puzzle #11

jbranchaud opened this issue Dec 18, 2024 · 0 comments

Comments

@jbranchaud
Copy link
Owner

The general idea is to:

  1. Generate a unique, valid, filled-in sudoku grid. Start with a solution and work backward to a puzzle.
  2. Dig holes: remove values from the grid until you have stepped far enough away from the solution to make an interesting puzzle but still have a puzzle that has a unique solution. As you're stepping backward, you'll reach a point where the grid no longer has a unique solution. You can either undo that hole and continue somewhere else on the board. Or you can undo that hole and consider that to be the puzzle.
  3. Rank the difficulty of the generated puzzles either manually or with an automated set of heuristics.
  4. Rotate the puzzle and rearrange its value to produce tons of variations on a single puzzle. With enough starting puzzles and randomization, there will be more than enough variety.

References

sudoku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant