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

added possibility to choose random number generator explicitly from outside #11

Merged
merged 4 commits into from Dec 2, 2023

Conversation

LordBlackhawk
Copy link
Contributor

Sometimes it is important to choose the random number generator explicitly from outside:

  • reproducable sudoku generation
  • compiling sudoku to web assembly target, since rand::thread_rng does not work there

@Emerentius
Copy link
Owner

Emerentius commented Dec 2, 2023

This is a good feature to have. I don't want to duplicate all generate_* functions for an explicit rng though, so I'm going to cut it down to only the minimal 2 functions needed for full generality: generate_solved_with_rng and generate_with_symmetry_and_rng_from.

I might swap sudoku generation to a builder style API in the future to curb the number of methods without sacrificing flexibility and conciseness.

@Emerentius Emerentius merged commit 2d7596f into Emerentius:master Dec 2, 2023
3 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants