simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Tue Dec 27 16:35:44 GMT 2022


TL;DR:
  4ec2c58 When filling in or blanking a square, don't generate null moves
  99d3c31 Tracks: Highlight more counting errors if track looks good

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:           2022-12-27 16:35:44

commit 4ec2c580453b0629b9935cb1e90017de6d110608
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=4ec2c580453b0629b9935cb1e90017de6d110608;hp=d3329734387dbaf972b651729245d4ffe7efcc4e
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Dec 26 11:25:00 2022 +0000

    When filling in or blanking a square, don't generate null moves
    
    This applies to various square-filling games: Keen, Solo, Towers,
    Undead, and Unequal.  In all cases, selecting a square and pressing the
    number that was already in it, or selecting an empty square and pressing
    Backspace, would add a move to the undo chain that did nothing.  This
    also meant that the convention where Backspace from the top level of an
    application in KaiOS leaves the application didn't work.
    
    Now the various interpret_move() functions check the current state of
    the grid, and return NULL or UI_UPDATE where a move wouldn't change the
    board.  UI_UPDATE is returned in the case where the cursor was put in
    place using the mouse, because in those cases I think the cursor should
    still be hidden again.  NULL is returned when the cursor was put in
    place by keyboard, because then there's really nothing to do.

 keen.c    | 14 ++++++++++++++
 solo.c    | 20 ++++++++++++++++++++
 towers.c  | 14 ++++++++++++++
 undead.c  | 12 +++++++++++-
 unequal.c | 19 +++++++++++++++++++
 5 files changed, 78 insertions(+), 1 deletion(-)

commit 99d3c31e12ac5bb7c12d2b7a59c702cb671e9b62
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=99d3c31e12ac5bb7c12d2b7a59c702cb671e9b62;hp=4ec2c580453b0629b9935cb1e90017de6d110608
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Tue Dec 27 16:14:48 2022 +0000

    Tracks: Highlight more counting errors if track looks good
    
    Normally, Tracks puts error marks on row and column clues only when one
    of the existing track or no-track marks will have to be removed to
    satisfy the clue.  This could lead to a situation where the player had
    built a track from A to B and got neither a win nor a highlighted error
    because the only error was in a row or column having too few track
    segments.
    
    This commit re-arranges the completion checking so that if there's a
    complete track from A to B and no spurious track then the game will
    highlight any clue that isn't matched by the actually laid track.  This
    should mean that any solution with a track from A to B will either be a
    win or have a highlighted error.
    
    This should fix Android issue #266.

 tracks.c | 118 +++++++++++++++++++++++++++++++++++----------------------------
 1 file changed, 65 insertions(+), 53 deletions(-)



More information about the tartarus-commits mailing list