338 karma · joined Jul 24, 2022 (4y ago) · 38 submissions
comment 3y ago · link · parent
Come open a discussion on github if you have further questions or just want to share your progress =) https://github.com/gereleth/hexapipes/discussions
comment 3y ago · link · parent
But I can tell you how it works for other grids =).
The contents of `tiles` key are an array of tile shapes. Possible directions where there are connections are binary-encoded. For example, on a square grid 1 means right, 2 means up, 4 means left and 8 means down. So a 3 means a corner piece connecting up and right, a 5 is a horizontal straight piece. A 0 means an empty tile, 15 in this case is a fully connected + tile. It's similar for other grids.
How the tiles are numbered depends on grid implementation. In a square 5x5 puzzle the indices would go like this:
0 1 2 3 4
5 6 7 8 9
...
You can look at grid implementations here: https://github.com/gereleth/hexapipes/tree/main/src/lib/puzz...
You can also import a downloaded puzzle (non-penrose) on the custom puzzle page and watch my solver work on it)). https://hexapipes.vercel.app/custom
comment 3y ago · link · parent
The bumpy history of this grid's development can be found in this issue: https://github.com/gereleth/hexapipes/issues/83
First hexapipes thread for context: https://news.ycombinator.com/item?id=32216436
comment 4y ago · link · parent
I have an idea of placing them with some kind of gesture - like touch and drag between tiles. That wouldn't interfere with tapping to rotate tiles. But on the other hand, I'm usually zoomed in on mobile and I use touch and drag to move around. Interfering with that would be bad too.
I'm open to ideas for better controls.
comment 4y ago · link · parent
With a randomize button do you mean a complete reset to initial state? Or something like keep the locked tiles, reset the rest?
comment 4y ago · link · parent
The hardest part was making the board repeat for the wrap variant making sure that all tiles have consistent wrap neighbours. I almost deployed a version that worked fine on odd-sized grids and went completely bananas on even-sized grids. The danger of always testing on a 5x5 board)).
comment 4y ago · link · parent
My svg handling was very much "learn as I go". An earlier version even had circles instead of hexagons because they're simpler to do. There's a cool playthrough video of that version: https://www.youtube.com/watch?v=vlpPr485NUY
comment 4y ago · link · parent
An efficient generator could perhaps even work client side, so I wouldn't have to store premade puzzle instances in the repo. That would be cool =).
comment 4y ago · link · parent
Wrap variants are another story as they have no outer edges. Discovering which tile groups give initial clues there is pretty fun too (when the regular puzzles aren't much of a challenge any more).