simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Mar 22 18:07:46 GMT 2023


TL;DR:
  09c15f2 New shared function, getenv_bool()
  6dac517 Add an environment variable to control initial cursor visibility
  0632a3c Treat environment variable values beginning with "T" as true
  b66a38b Turn on PUZZLES_SHOW_CURSOR on KaiOS

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-03-22 18:07:46

commit 09c15f206edac18bd2158c189c821b9ba85d3939
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=09c15f206edac18bd2158c189c821b9ba85d3939;hp=adf2a098298f1aa73aca2c816174d5e63ff45a32
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Wed Mar 22 16:06:18 2023 +0000

    New shared function, getenv_bool()
    
    This provides a standard way to get a boolean from an environment
    variable.  It treats the variable as true iff its value begins with 'y'
    or 'Y', like most of the current implementations.  The function takes a
    default value which it returns if the environment variable is undefined.
    
    This replaces the various ad-hoc tests of environment variable scattered
    around and mostly doesn't change their behaviour.  The exceptions are
    TOWERS_2D in Towers and DEBUG_PUZZLES in the Windows front end.  Both of
    those were treated as true if they were defined at all, but now follow
    the same rules as other boolean environment variables.

 emcc.c     | 6 +-----
 fifteen.c  | 6 ++----
 lightup.c  | 7 ++-----
 loopy.c    | 7 ++-----
 misc.c     | 8 ++++++++
 pearl.c    | 3 +--
 puzzles.h  | 2 ++
 range.c    | 6 ++----
 signpost.c | 6 ++----
 slant.c    | 6 ++----
 towers.c   | 2 +-
 windows.c  | 2 +-
 12 files changed, 26 insertions(+), 35 deletions(-)

commit 6dac51795e5672f32bba787c0f011cb01e464a96
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=6dac51795e5672f32bba787c0f011cb01e464a96;hp=09c15f206edac18bd2158c189c821b9ba85d3939
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Wed Mar 22 16:58:22 2023 +0000

    Add an environment variable to control initial cursor visibility
    
    If you define PUZZLES_INITIAL_CURSOR=y, puzzles that have a keyboard
    cursor will default to making it visible rather than invisible at the
    start of a new game.  Behaviour is otherwise the same, so mouse actions
    will cause the cursor to vanish and keyboard actions will cause it to
    appear.  It's just the default that has changed.
    
    The purpose of this is for use on devices and platforms where the
    primary or only means of interaction is keyboard-based.  In those cases,
    starting with the keyboard cursor invisible is weird and a bit
    confusing.

 blackbox.c | 2 +-
 bridges.c  | 2 +-
 dominosa.c | 2 +-
 filling.c  | 2 +-
 flip.c     | 2 +-
 flood.c    | 2 +-
 galaxies.c | 2 +-
 guess.c    | 1 +
 keen.c     | 3 +--
 lightup.c  | 2 +-
 magnets.c  | 2 +-
 map.c      | 2 +-
 mines.c    | 2 +-
 mosaic.c   | 2 +-
 net.c      | 2 +-
 netslide.c | 2 +-
 palisade.c | 2 +-
 pattern.c  | 2 +-
 pearl.c    | 2 +-
 pegs.c     | 2 +-
 range.c    | 2 +-
 rect.c     | 2 +-
 samegame.c | 2 +-
 signpost.c | 2 +-
 singles.c  | 2 +-
 sixteen.c  | 2 +-
 slant.c    | 2 +-
 solo.c     | 3 +--
 tents.c    | 2 +-
 towers.c   | 3 +--
 tracks.c   | 2 +-
 twiddle.c  | 2 +-
 undead.c   | 5 ++---
 unequal.c  | 3 +--
 unruly.c   | 2 +-
 35 files changed, 36 insertions(+), 40 deletions(-)

commit 0632a3c2e4474014a6c081b87c253cc55d7c2109
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=0632a3c2e4474014a6c081b87c253cc55d7c2109;hp=6dac51795e5672f32bba787c0f011cb01e464a96
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Wed Mar 22 17:56:10 2023 +0000

    Treat environment variable values beginning with "T" as true
    
    So a value is true iff it begins with 'T', 't', 'Y', or 'y'.  This is
    mostly so that naively converting JSON "true" to a string will work
    properly, but it should keep LISPers happy too.

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

commit b66a38bbdc4405cce7050b8e8bbcae8d69c3dc2c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=b66a38bbdc4405cce7050b8e8bbcae8d69c3dc2c;hp=0632a3c2e4474014a6c081b87c253cc55d7c2109
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Wed Mar 22 17:59:14 2023 +0000

    Turn on PUZZLES_SHOW_CURSOR on KaiOS
    
    Most KaiOS devices are primarily keyboard-based, so this seems like a
    reasonable approach.
    
    I've also switched to specifying boolean values as JSON booleans because
    that works now.

 kaios/apppage.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



More information about the tartarus-commits mailing list