simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Feb 5 20:58:28 GMT 2023


TL;DR:
  84ec2a0 Unequal: Don't insist that solve moves must actually solve
  ae73ad7 Range: Don't fail an assertion on an all-black board

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2023-02-05 20:58:28

commit 84ec2a0a77d63450311f7c25b36d4b9f7e3c53e1
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=84ec2a0a77d63450311f7c25b36d4b9f7e3c53e1;hp=9ce0a6d93212ffc0986a2b399fd8e9e983f62904
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Feb 4 16:18:27 2023 +0000

    Unequal: Don't insist that solve moves must actually solve
    
    A corrupt save file can include an "S" move that doesn't give a valid
    solution.  An assertion failure ("execute_move: Assertion `rc > 0'
    failed.") at that point is rude, so now we just don't set the
    "completed" flag in that case.  We still set the "cheated" flag, to
    reward (lack of) effort.
    
    Here's a trivial test case:
    
    SAVEFILE:41:Simon Tatham's Portable Puzzle Collection
    GAME    :7:Unequal
    CPARAMS :1:3
    PARAMS  :1:3
    DESC    :17:0,0,0,0,0,0,0,0,0
    NSTATES :1:2
    STATEPOS:1:2
    MOVE    :10:S222222222

 unequal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

commit ae73ad76ef95f0e40868436cb750126322051dd0
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ae73ad76ef95f0e40868436cb750126322051dd0;hp=84ec2a0a77d63450311f7c25b36d4b9f7e3c53e1
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Feb 4 16:50:55 2023 +0000

    Range: Don't fail an assertion on an all-black board
    
    If there are no white squares, then Range's check that all the white
    squares form a connected component goes wrong.  Skip the check in that
    case to avoid an assretion violation ("edsf_canonify: Assertion `index
    >= 0' failed.").  This can be demonstrated by starting a game with no
    clues (e.g. "range 3:i") and then filling in every square.

 range.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



More information about the tartarus-commits mailing list