simon-git: puzzles (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon May 1 14:35:31 BST 2023


TL;DR:
  c48a9f4 Replace check of __STDC_VERSION__ with HAVE_STDINT_H.
  628cc67 Untangle: replace manual int64 bodging with int64_t.
  e0bb6d3 Untangle: add a 'snap to grid' user preference.

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:           2023-05-01 14:35:31

commit c48a9f44ffdd2bd2055a5296c84874716dd303b9
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c48a9f44ffdd2bd2055a5296c84874716dd303b9;hp=4de9836bc8c36cddead5e9efc6beff0692118b1e
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon May 1 13:42:43 2023 +0100

    Replace check of __STDC_VERSION__ with HAVE_STDINT_H.
    
    Just spotted this in puzzles.h. We don't need to guess any more from
    the C standards version whether stdint.h is available: we've actually
    checked _precisely that_ in cmake, so it's better to use the answer.

 puzzles.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 628cc6785b2cfa3d4ee6101667e4bb9e11095eec
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=628cc6785b2cfa3d4ee6101667e4bb9e11095eec;hp=c48a9f44ffdd2bd2055a5296c84874716dd303b9
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon May 1 13:49:54 2023 +0100

    Untangle: replace manual int64 bodging with int64_t.
    
    Where possible, that is. If our compilation environment has provided
    int64_t, we can just make our int64 type be that, and not have to mess
    around with multi-word arithmetic at all.

 untangle.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

commit e0bb6d3b8546ea67e79cb190a96c26961ddacdf6
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=e0bb6d3b8546ea67e79cb190a96c26961ddacdf6;hp=628cc6785b2cfa3d4ee6101667e4bb9e11095eec
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon May 1 14:24:56 2023 +0100

    Untangle: add a 'snap to grid' user preference.
    
    Requested by a user who otherwise found themself spending too much
    time struggling to get lines nicely horizontal or vertical.
    
    The implementation is easy, but the question is what size of grid is
    appropriate. Untangle's own generated games are constructed by making
    a planar graph drawn on an extremely coarse grid - but snapping to
    _that_ grid would give away information about the puzzle solution, and
    also, Untangle wouldn't know any similar information about graphs
    generated by any other method.
    
    So a better approach is to choose a size of grid that guarantees that
    _any_ graph with n vertices can be drawn on it with nonintersecting
    straight edges. That sounds like a tricky maths problem - but happily,
    the solution is given in a book I already had a copy of. References in
    a comment (plus a proof of a pedantic followup detail about multiple
    planar embeddings).

 untangle.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 90 insertions(+), 7 deletions(-)



More information about the tartarus-commits mailing list