mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00

This is another modification to the same piece of code as the previous commit. Previously, a square with a neighbour in a same-sized region was fixed by choosing a neighbour to merge it with that was part of the smallest region. Now, it's _usually_ that, but sometimes it can be a larger neighbour instead. Partly, I hope this might remove a potential source of regularity in the random grids. But mostly, it prevents the grid generator from hanging completely on 2x2 grids (e.g. if you gave "2x2#12345" in the previous state of the code), because with the previous 'always minimal' rule, the generator would merge together two squares of the 2x2 grid, then the other two, and then (due to maxsize==3) it would have no merge remaining to clear the final error. Now, every so often, it will take the unusual option of making a size-3 region instead, which allows game generation to succeed.
This is the README accompanying the source code to Simon Tatham's puzzle collection. The collection's web site is at <https://www.chiark.greenend.org.uk/~sgtatham/puzzles/>. The puzzle collection is built using CMake <https://cmake.org/>. To compile in the simplest way (on any of Linux, Windows or Mac), run these commands in the source directory: cmake . cmake --build . The manual is provided in Windows Help format for the Windows build; in text format for anyone who needs it; and in HTML for the Mac OS X application and for the web site. It is generated from a Halibut source file (puzzles.but), which is the preferred form for modification. To generate the manual in other formats, rebuild it, or learn about Halibut, visit the Halibut website at <https://www.chiark.greenend.org.uk/~sgtatham/halibut/>.
Description
Languages
C
93.3%
JavaScript
1.4%
Objective-C
1.1%
CMake
1.1%
HTML
0.8%
Other
2.2%