gereleth
Joined 4 years ago
Joined 4 years ago
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)).
Come open a discussion on github if you have further questions or just want to share your progress =) https://github.com/gereleth/hexapipes/discussions