simon-git: puzzles (main): Ben Harris
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Jun 25 14:06:13 BST 2023
TL;DR:
dd0004f Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Dominosa
f749a33 Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Filling
88f8691 Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Flip
c224416 Reduce the set of keys from which we generate control characters
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-06-25 14:06:13
commit dd0004fb5ebb581eced0820cd6373f88e98d93e3
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=dd0004fb5ebb581eced0820cd6373f88e98d93e3;hp=1d565270144003e6f5406b208d4ab35a1ac14fcb
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sat Jun 24 18:23:03 2023 +0100
Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Dominosa
The only tricky bit is whether clicking precisely on the diagonal of a
square (which never has any effect on the game) is MOVE_UNUSED or
MOVE_NO_EFFECT. I decided that having single-pixel lines in the middle
of the grid causing events to be passed back to the environment would be
very confusing, so they're MOVE_NO_EFFECT. Clicking entirely outside
the grid, on the other hand, returns MOVE_UNUSED.
dominosa.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
commit f749a33c5eeb67b19305085feebfe35b0ccaffd0
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=f749a33c5eeb67b19305085feebfe35b0ccaffd0;hp=dd0004fb5ebb581eced0820cd6373f88e98d93e3
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sat Jun 24 18:31:24 2023 +0100
Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Filling
filling.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
commit 88f86918bfca1935c07eee7f84d98e32ccc2f593
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=88f86918bfca1935c07eee7f84d98e32ccc2f593;hp=f749a33c5eeb67b19305085feebfe35b0ccaffd0
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sat Jun 24 18:37:58 2023 +0100
Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Flip
flip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit c224416c76e41f284b318adc51f08c3ed11de8e2
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c224416c76e41f284b318adc51f08c3ed11de8e2;hp=88f86918bfca1935c07eee7f84d98e32ccc2f593
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Jun 25 13:54:21 2023 +0100
Reduce the set of keys from which we generate control characters
midend_process_key() has some generic code for converting MOD_CTRL along
with a printing character into a control character. This is derived
from the Emscripten front-end because browsers don't do this themselves.
Most other front ends seem to depend on the platform for this mapping.
The mapping was applied to all printable ASCII characters, but this
meant that Ctrl+-, which is commonly used by browsers to mean "zoom out"
got converted into CR and then CURSOR_SELECT. That was confusing to say
the least.
So now, the CTRL mapping is only applied to characters in the roughly
alphabetic range (0x40 to 0x7f), and MOD_CTRL applied to a character in
the range 0x20 to 0x3f gets a return of PKR_UNUSED instead. That means
that Ctrl+- in browsers now works properly.
I don't think this will affect other front-ends because they're
generally a lot less generous about passing MOD_CTRL to the mid-end.
I've tested the GTK port nonetheless and not found any problems.
midend.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
More information about the tartarus-commits
mailing list