Posted May 17, 2023 by HopefulToad
#update #bugfix #patch
Randomly generated puzzles are here! Now, you'll never run out of puzzles to solve again! Assuming you don't mind solving puzzles that don't form images, that is.
To generate a random puzzle to solve, just click the Play button on the title screen (renamed from "Puzzle select"), then select the "Generate a random puzzle" option. You can then pick the size of puzzle you want to generate, as well as the relative complexity* of the randomly generated puzzle**.
If you want to stop working on the puzzle and save it for later, just pause and select "Exit". You'll be prompted to save it to your user puzzles, where you'll be able to continue working on it at another time. You can also save the puzzle once it's completed if you liked it, or even share it using the clipboard sharing method.***
Additionally, new puzzle assistance options have been added to the game. You can now enable an assist that will point out rows and columns that can be worked on, to help you narrow down where to look. Also, enabled by default is a new, more advanced method of fading out hints**** that can more accurately determine which hints need to be greyed out. If you feel the new hint fading method is a bit too
helpful for your taste, you can always disable it to return to the original method that the game launched with.
A full list of the changes made can be found below. I hope you enjoy the new additions!
Note: Enabling advanced hint fading or the new assist that points out workable lines has a performance impact due to them requiring a puzzle solver/validator to work. Puzzles can potentially have tens, hundreds, or even millions of total possible combinations that the solver has to comb through, so for certain very large puzzles, this could have a negative impact on your experience if you're running on low-end hardware. Disabling both advanced hint fading (which is now on by default) and the option to point out workable lines will stop the solver from running and should return CPU usage to the same level as before this update.
This update was made possible by adding an efficient puzzle validator/solver to the game, which I was only able to do thanks to two excellent articles on the web. The overall algorithm and method of solving a nonogram was adapted from Hennie de Harder's article "Solving Nonograms with 120 Lines of Code" (https://towardsdatascience.com/solving-nonograms-with-120-lines-of-code-a7c6e0f627e4). (Thanks for pointing out the article, Rushin'!) After implementing my own method of generating all possible combinations that ended up being way too slow to be used for my intended purposes in Nonozle, I found a much more efficient way to generate them all described in James McCaffrey's article "Lightweight Mathematical Combinations Using C#" (https://visualstudiomagazine.com/articles/2022/07/20/math-combinations-using-csharp.aspx).
* Complexity is determined using total number of possible combinations for all rows and columns of a puzzle.
** Complexity can't be selected for 30x30 puzzles, as it already takes long enough to simply find a random puzzle that size that's actually solvable, much less one that falls within a specified range of total possible combinations.
*** Shutting down the game without first converting it into a user puzzle will result in the loss of the puzzle, so be careful.
**** Hints is the term I use for the numbers that line the sides of a nonogram.