simon-git: puzzles (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Fri May 9 08:12:14 BST 2025


TL;DR:
  50985e9 Mosaic: make solver notice when it gets stuck.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2025-05-09 08:12:14

commit 50985e9f2c54ad44e8c26491ddddd698bc02fd06
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=50985e9f2c54ad44e8c26491ddddd698bc02fd06;hp=7da46412223273b3adf6d513466342b9d3a5c869
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri May 9 08:07:19 2025 +0100

    Mosaic: make solver notice when it gets stuck.
    
    The top-level solver loop had a boolean 'made_progress' among its loop
    conditions, on the theory that if the solver got stuck then it would
    fail to make progress and the loop would terminate after it had tried
    everything it knew how to do. But made_progress started off as true,
    and nothing ever set it to false, so this check never did anything!
    
    Now we set made_progress to false at the start of each iteration of
    the outermost while loop, and then if we scour the whole grid without
    setting it to true, the while loop will stop and solve_game_actual()
    will report failure.

 mosaic.c | 1 +
 1 file changed, 1 insertion(+)



More information about the tartarus-commits mailing list