Lurker News
Hello, HN - I wanted to share this puzzle game I made during my vacation.

I'm rather fond of the pipes puzzle where your goal is to restore a scrambled network of connections by rotating tiles. It's usually played on a grid of squares and this all started when I decided to make a programmatic solver for that kind of puzzle. Then I realized that with some minor changes the solver could generate new puzzle instances. I thought about what kind of puzzle to make and someone suggested a hexagonal grid. Adapting the generator wasn't too hard but then I had to create a way to play this variant. So I did just that =).
I find hexagonal pipes a bit more difficult than the square variant because there's a larger variety of possible tile shapes. For an extra challenge I implemented wrap mode where the board can connect to itself (right to left and top to bottom), so there are no convenient outer walls to start from.
The site is made with Svelte Kit, its code is available on github at <https://github.com/gereleth/hexapipes>.
Hope you enjoy playing =).

Comments (161) 65 threads

Show all comments

Showing thread 16 of 65

ranman2 replies#
Why are the SVG tiles specified to 599.99999999 instead of 600 or something? I think a SVGO optimizations run would reduce the size of the assets a tad.
Etheryte#
I would guess that the assets were made in Inkscape or comparable software where you work visually and don't actually look at the generated code.
gereleth1 reply#
There aren't really any assets though. I just create the svgs dynamically. Maybe I need to place some strategic `Math.round` calls here and there, never thought of this =).
ranman1 reply#
Yeah so if you can math.round or math.floor them a bit the paths are a lot cleaner - if you're dynamically creating them anyway though then I don't know that it gains you much performance. It might gain some performance on render for larger maps? Not sure.

Didn't get a chance to look at your source.