simon-git: puzzles (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Wed Apr 26 22:07:25 BST 2017
TL;DR:
e37d915 New Loopy tiling: 'Great Great Dodecagonal'.
ce6e3df Use symbolic enum values in the Loopy presets array.
bc2c1f6 Javascript puzzles: switch to a CSS-based drop-down system.
a7dc17c Rework the preset menu system to permit submenus.
e3821d1 Use the new hierarchical preset menu feature in Loopy.
2d33375 Loopy: optional 'autofollow' UI feature.
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2017-04-26 22:07:25
commit e37d915f447e02b52236cee454dfe68749c6d876
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=e37d915f447e02b52236cee454dfe68749c6d876;hp=eedea4132043cc4c788ee89f1ccb0783893125c5
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Apr 23 07:41:46 2017 +0100
New Loopy tiling: 'Great Great Dodecagonal'.
Officially known as the '3-4-6-12 tiling', according to, e.g.,
https://en.wikipedia.org/wiki/3-4-6-12_tiling .
Thanks to Michael Quevillon for contributing this patch (and for
choosing a less hard-to-remember name for the tiling :-).
grid.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
grid.h | 1 +
loopy.c | 3 ++
3 files changed, 173 insertions(+)
commit ce6e3df99bc7825d1c1638d378320375eb05fd0b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ce6e3df99bc7825d1c1638d378320375eb05fd0b;hp=e37d915f447e02b52236cee454dfe68749c6d876
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Apr 24 17:09:30 2017 +0100
Use symbolic enum values in the Loopy presets array.
The use of plain numbers was needlessly confusing, and in particular
made it too easy to make unintended changes to the existing Loopy
presets when inserting a new grid enum value anywhere other than at
the end of the list.
But in the course of doing this I realised that, against all
sensibleness, the numeric indices for grid types in grid.h and in
Loopy itself don't match up! Right now I don't want to get sidetracked
into fixing the structural confusion that made that happen in the
first place, but I've at least materialised Loopy's version of the
enum with clearly identifiable LOOPY_GRID_* names.
loopy.c | 134 +++++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 78 insertions(+), 56 deletions(-)
commit bc2c1f69fddac3a51d086fb379f0ec8954f4b894
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=bc2c1f69fddac3a51d086fb379f0ec8954f4b894;hp=ce6e3df99bc7825d1c1638d378320375eb05fd0b
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Apr 26 14:39:45 2017 +0100
Javascript puzzles: switch to a CSS-based drop-down system.
The previous control buttons and dropdowns based on form elements were
always a bit ugly: partly in a purely visual sense, and partly because
of the nasty bodge I had to do with splitting the usual 'Custom' game
type menu item into two (to get round the fact that if an element of a
<select> is already selected, browsers won't send an event when it's
re-selected). Also, I'm about to want to introduce hierarchical
submenus in the Type menu, and <select> doesn't support that at all.
So here's a replacement system which does everything by CSS
properties, including the popping-up of menus when the mouse moves
over their parent menu item. (Thanks to the Internet in general for
showing me how that trick is done.)
emcc.c | 2 +-
emcclib.js | 90 ++++++++++++++----------------------
emccpre.js | 33 ++++++--------
html/jspage.pl | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
4 files changed, 180 insertions(+), 87 deletions(-)
commit a7dc17c4258837b0ee3927f1db5e1c02acee5cc3
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=a7dc17c4258837b0ee3927f1db5e1c02acee5cc3;hp=bc2c1f69fddac3a51d086fb379f0ec8954f4b894
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Apr 24 16:00:24 2017 +0100
Rework the preset menu system to permit submenus.
To do this, I've completely replaced the API between mid-end and front
end, so any downstream front end maintainers will have to do some
rewriting of their own (sorry). I've done the necessary work in all
five of the front ends I keep in-tree here - Windows, GTK, OS X,
Javascript/Emscripten, and Java/NestedVM - and I've done it in various
different styles (as each front end found most convenient), so that
should provide a variety of sample code to show downstreams how, if
they should need it.
I've left in the old puzzle back-end API function to return a flat
list of presets, so for the moment, all the puzzle backends are
unchanged apart from an extra null pointer appearing in their
top-level game structure. In a future commit I'll actually use the new
feature in a puzzle; perhaps in the further future it might make sense
to migrate all the puzzles to the new API and stop providing back ends
with two alternative ways of doing things, but this seemed like enough
upheaval for one day.
PuzzleApplet.java | 61 ++++++++---
blackbox.c | 2 +-
bridges.c | 2 +-
cube.c | 2 +-
devel.but | 170 ++++++++++++++++++++++++-----
dominosa.c | 2 +-
emcc.c | 41 ++++---
emcclib.js | 59 ++++++----
emccpre.js | 4 +-
fifteen.c | 2 +-
filling.c | 2 +-
flip.c | 2 +-
flood.c | 2 +-
galaxies.c | 2 +-
gtk.c | 126 +++++++++++++---------
guess.c | 2 +-
inertia.c | 2 +-
keen.c | 2 +-
lightup.c | 2 +-
loopy.c | 2 +-
magnets.c | 2 +-
map.c | 2 +-
midend.c | 291 ++++++++++++++++++++++++++++++++++----------------
mines.c | 2 +-
nestedvm.c | 31 ++++--
net.c | 2 +-
netslide.c | 2 +-
nullfe.c | 5 +
nullgame.c | 2 +-
osx.m | 109 ++++++++++++++-----
palisade.c | 2 +-
pattern.c | 2 +-
pearl.c | 2 +-
pegs.c | 2 +-
puzzles.h | 53 ++++++++-
range.c | 2 +-
rect.c | 2 +-
samegame.c | 2 +-
signpost.c | 2 +-
singles.c | 2 +-
sixteen.c | 2 +-
slant.c | 2 +-
solo.c | 2 +-
tents.c | 2 +-
towers.c | 2 +-
tracks.c | 2 +-
twiddle.c | 2 +-
undead.c | 2 +-
unequal.c | 2 +-
unfinished/group.c | 2 +-
unfinished/separate.c | 2 +-
unfinished/slide.c | 2 +-
unfinished/sokoban.c | 2 +-
unruly.c | 2 +-
untangle.c | 2 +-
windows.c | 122 ++++++++++++++-------
56 files changed, 814 insertions(+), 346 deletions(-)
commit e3821d1f68bf531fa485fd5b4c2882b838824347
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=e3821d1f68bf531fa485fd5b4c2882b838824347;hp=a7dc17c4258837b0ee3927f1db5e1c02acee5cc3
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Apr 24 17:06:36 2017 +0100
Use the new hierarchical preset menu feature in Loopy.
This is the game for which I bothered to introduce the feature at all.
Because of the large number of grid types, the presets menu was
getting quite unwieldy; but because the grid dimensions for each grid
type are more or less arbitrary, it's still useful to have at least
one reasonably sized example of each grid type. So I've compromised by
moving some of the grid types into a 'More' submenu.
(I'm not particularly wedded to _which_ settings deserve relegation. I
may change my mind and move things about later on.)
loopy.c | 67 ++++++++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 43 insertions(+), 24 deletions(-)
commit 2d333750272c3967cfd5cd3677572cddeaad5932
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=2d333750272c3967cfd5cd3677572cddeaad5932;hp=e3821d1f68bf531fa485fd5b4c2882b838824347
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Apr 24 18:32:57 2017 +0100
Loopy: optional 'autofollow' UI feature.
This is mostly intended to make play more convenient for grid types
like the new Great-Great-Dodecagonal, and other grids with very
high-degree faces, in which it's annoying to have to spend half a
dozen mouse clicks on filling in a path of edges round the outside of
one of those faces which clearly have to all be set (or clear) if any
one of them is.
For now, the new feature is enabled by yet another of my hacky
environment variables, called LOOPY_AUTOFOLLOW. You can set it to
"off", "fixed" or "adaptive", where "off" is currently the default
(hence, no user-visible change in the default behaviour from this
change). If set to 'fixed', then toggling the state of any edge will
automatically toggle any further edges which are in the same state and
share a degree-2 vertex of the underlying grid design with the
original one. In 'adaptive' mode, the game goes even further, and will
consider outgoing edges in LINE_NO state not to count for purposes of
deciding if a vertex has degree 2.
loopy.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 58 insertions(+), 4 deletions(-)
More information about the tartarus-commits
mailing list