simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Feb 1 23:02:32 GMT 2023


TL;DR:
  ed0e4c3 Fix move validation in Netslide

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-01 23:02:32

commit ed0e4c304bed990948541fc0cf87309d75653806
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ed0e4c304bed990948541fc0cf87309d75653806;hp=875f0af21fbced5cbf6cf63b86fe3dc51682c863
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Wed Feb 1 23:00:14 2023 +0000

    Fix move validation in Netslide
    
    The maximum length of a column move in Netslide is the height of the
    puzzle, and the maximum length of a row move is the width, not the
    other way around.
    
    Moves of absolute length more than 1 can't be generated by
    interpret_move(), but they can come from save files.  On non-square
    grids, the incorrect check led to assertion failures: "0 <= tx && tx <
    w" and "0 <= ty && ty < h".  This save file demonstrates the problem:
    
    SAVEFILE:41:Simon Tatham's Portable Puzzle Collection
    GAME    :8:Netslide
    PARAMS  :3:4x9
    CPARAMS :3:4x9
    DESC    :39:0000000000000h0h0000000000000000000000v
    NSTATES :1:2
    STATEPOS:1:2
    MOVE    :4:R0,5

 netslide.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list