Come open a discussion on github if you have further questions or just want to share your progress =) https://github.com/gereleth/hexapipes/discussions
338 karma · joined July 24, 2022
Come open a discussion on github if you have further questions or just want to share your progress =) https://github.com/gereleth/hexapipes/discussions
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
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
Sorry about your sleep schedule).
This contextmenu issue is sure showing me the ugly side of frontend development :/
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.
With a randomize button do you mean a complete reset to initial state? Or something like keep the locked tiles, reset the rest?
You sure are brave to take on a 40x40 =)
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)).
You can try the wrap variant for an extra challenge.
All general principles still apply though, so experience with Net certainly helps here.
And good time on the wrap! Small wrap boards can actually be harder than larger ones because there's less chance of finding some seed tiles to start from.
My wrap puzzles show an infinite tiled grid, so there shouldn't be questions about which edge wraps where. There are no edges, tiles just start repeating after a while. Maybe I didn't understand your question about wrapping?
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
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 =).
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).