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

Improve board generation #28

Closed
rspilker opened this issue Oct 30, 2018 · 1 comment
Closed

Improve board generation #28

rspilker opened this issue Oct 30, 2018 · 1 comment

Comments

@rspilker
Copy link
Contributor

rspilker commented Oct 30, 2018

Some boards are great, others not so.

Currently the board is generated by randomly selecting letters based on the frequency they occur in their language.

Some problems:

  • Clusters of consonants. (dead letters, not part of any dictionary word)
  • Lonely X and Q
  • Boards with too few solutions

Possible improvements:

  • Start with placing a 9+ word on the board. Possibly adjust the bias for generating the rest of the letters.
  • Use letter combination frequency (we can generate those from the dictionary) to improve the chances of finding words that contain letters that have a low frequency. Examples: 'Q' raises the chance of a neighboring 'U', or in Dutch, improve the chances of generating a 'sch' or 'ij' path.
  • Replace dead letters. Letters that are not part of any of the found words can be replaced by other letters. Possibly it is easier to regenerate a whole new board. Don't forget to stop after a few tries. We could also say that each board letter should be part of at least two words. Keep in mind that the solver needs to be able to find all occurrences of the dictionary words for this to work.
  • Build the board by fitting dictionary words, not by selecting single letters. (nice programming challenge). The difference with replacing dead letters is that this can optimize for putting in as many words as possibly. The algorithm should not be too strict to prevent generating the same puzzles.

Or a combination of some of the ideas above.

@bennorichters
Copy link
Owner

OK, here is what I did:

  • The board is build with letter frequencies that have a sequence of three characters instead of just one. This makes it more likely that words can be formed.
  • If despite this the solution has zero words, it will insert a randomly chosen word of length four at a random place. This obviously guarantees there is at least one word to find and likely more.

I am closing this issue. Do let the Bnoggles team know if you have more wishes. I will find someone to assign it to.

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

2 participants