simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Feb 13 21:40:58 GMT 2023


TL;DR:
  a2bf050 Reserialise the game in fuzzpuzz
  ffe2fa1 Extend fuzzpuzz to test more code
  c3a5a78 Validate that save file values are ASCII (mostly)
  e8668dc More validation of solve moves in Flood

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-13 21:40:58

commit a2bf0508c7256a62d973446fce841504580e2591
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=a2bf0508c7256a62d973446fce841504580e2591;hp=df783b93e3271264a8d54f90876f41a80ef2247d
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sun Feb 12 16:25:48 2023 +0000

    Reserialise the game in fuzzpuzz
    
    This means that the serialising code gets tested, and also provides a
    convenient way to canonicalise a (valid) save file.

 fuzzpuzz.c | 8 ++++++++
 1 file changed, 8 insertions(+)

commit ffe2fa169f9fdc411d00e1c75cf3cdc5f3099727
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ffe2fa169f9fdc411d00e1c75cf3cdc5f3099727;hp=a2bf0508c7256a62d973446fce841504580e2591
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sun Feb 12 22:57:51 2023 +0000

    Extend fuzzpuzz to test more code
    
    Now if the input save file loads correctly, fuzzpuzz asks the back-end
    to draw the puzzle.  All the drawing operations are no-ops, but this
    tests the drawing code in the back-end.

 fuzzpuzz.c |  8 +++++++-
 nullfe.c   | 10 ++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

commit c3a5a7842eb6c41fb75a8a110a3f2cbc1c8fc5d9
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c3a5a7842eb6c41fb75a8a110a3f2cbc1c8fc5d9;hp=ffe2fa169f9fdc411d00e1c75cf3cdc5f3099727
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sun Feb 12 23:04:12 2023 +0000

    Validate that save file values are ASCII (mostly)
    
    Apart from "SEED" records, all values in save files generated by Puzzles
    should be printable ASCII.  This is enforced by assertion in the saving
    code.  However, if a save file with non-ASCII move strings (for
    instance) manages to get loaded then these non-ASCII values can cause an
    assertion failure on saving.  Instead, the loading code now checks
    values for ASCIIness.
    
    This will not only avoid problems when re-saving files, but will also
    defend the various internal parsers from at least some evil strings.  It
    shouldn't invalidate any save files actually generated by Puzzles, but
    it will sadly invalidate some of my fuzzing corpus.

 midend.c | 7 +++++++
 1 file changed, 7 insertions(+)

commit e8668dc883e940f0852ff4520abc3d30cae90aef
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=e8668dc883e940f0852ff4520abc3d30cae90aef;hp=c3a5a7842eb6c41fb75a8a110a3f2cbc1c8fc5d9
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Feb 13 00:00:30 2023 +0000

    More validation of solve moves in Flood
    
    To avoid assertion failures while painting it, we need to ensure that
    the purported solution in a solve move doesn't include filling with the
    current top-left colour at any point.  That means checking the first
    entry against the current top-left colours, and each later one against
    its predecessor.

 flood.c | 5 +++++
 1 file changed, 5 insertions(+)



More information about the tartarus-commits mailing list