simon-git: puzzles (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Feb 18 21:17:43 GMT 2019


TL;DR:
  6836323 Galaxies: prevent creation of empty undo-chain items.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2019-02-18 21:17:43

commit 68363231f062192156799af7a153fc3ab3a0f5ed
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=68363231f062192156799af7a153fc3ab3a0f5ed;hp=1ba4e37228e6eae0d09c0cca7f4ab7fb489fdc9d
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 18 21:12:16 2019 +0000

    Galaxies: prevent creation of empty undo-chain items.
    
    If you drag an arrow on to a square which is already filled in as part
    of a completed region, or whose counterpart is filled in, or whose
    counterpart is actually a dot, then the game can't actually place a
    double arrow. Previously, it didn't find that out until execute_move
    time, at which point it was too late to prevent a no-op action from
    being placed on the undo chain.
    
    Now we do those checks in interpret_move, before generating the move
    string that tries to place the double arrow in the first place. So
    execute_move can now enforce by assertion that arrow-placement moves
    it gets are valid.

 galaxies.c | 56 +++++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 17 deletions(-)



More information about the tartarus-commits mailing list