simon-git: puzzles (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Oct 21 20:43:43 BST 2021


TL;DR:
  49d28f2 Tents: fix bias in tent placement.
  ad1c6ad Galaxies: store game solution in the aux string.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2021-10-21 20:43:43

commit 49d28f2204dfbb21156d98b0313399c8126b59e0
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=49d28f2204dfbb21156d98b0313399c8126b59e0;hp=42cbd7688a7f05e0a5d56a603a04293307c1e1b2
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Oct 21 20:39:09 2021 +0100

    Tents: fix bias in tent placement.
    
    In the very first stage of game generation, we're supposed to pick 1/5
    of the grid squares to put tents in, in a uniformly random manner. It
    failed to be uniform, because I had the wrong limit in random_upto -
    but it was too small rather than too large, so it never overran the
    buffer in a way that something like ASan or valgrind would have caught.

 tents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit ad1c6ade2af0e681fb964a17cc3a031951047068
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ad1c6ade2af0e681fb964a17cc3a031951047068;hp=49d28f2204dfbb21156d98b0313399c8126b59e0
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Oct 21 20:40:36 2021 +0100

    Galaxies: store game solution in the aux string.
    
    Most games store a string in 'aux' during new_game_desc() that saves
    solve_game() during gameplay from having to reconstruct the solution
    from scratch. Galaxies had all the facilities available to do that,
    but apparently just forgot to use them.
    
    (Reindents existing code: diff best viewed with whitespace ignored.)

 galaxies.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)



More information about the tartarus-commits mailing list