simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Fri Feb 3 22:55:13 GMT 2023


TL;DR:
  843d4ca Tolerate incorrect solutions in Inertia

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-03 22:55:13

commit 843d4ca17def11671809786f2a5aebd75f230dd9
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=843d4ca17def11671809786f2a5aebd75f230dd9;hp=15f4fa851a5781cf77984a6046405ffa758e7b33
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Fri Feb 3 20:52:05 2023 +0000

    Tolerate incorrect solutions in Inertia
    
    The "solve" operation in Inertia generates a proposed solution as a
    move string.  But if such a move string is loaded from a save file it
    might not actually describe a solution.  If that happens then it's
    possible to reach the end of the "solution" without winning, and doing
    so should probably cause a recalculation of the solution rather than
    an assertion failure ("execute_move: Assertion `ret->solnpos <
    ret->soln->len' failed.").
    
    I am a little concerned by the way that normal solve operations end up
    encoded in the save file, but the re-solvings caused by going off
    course don't, but I haven't got a good answer to that.
    
    Here's a save file that demonstrates the assertion failure:
    
    SAVEFILE:41:Simon Tatham's Portable Puzzle Collection
    GAME    :7:Inertia
    PARAMS  :3:8x8
    CPARAMS :3:8x8
    DESC    :64:sbgwsmswwgggwggmmbwgwbssbwbsbwbbwsSmwbbsbbmggbmssgmgwbmmwmbmmwsw
    NSTATES :2:3
    STATEPOS:1:1
    MOVE 000:2:S0
    MOVE 000:2:00

 inertia.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)



More information about the tartarus-commits mailing list