Live data from Hacker News

Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

hexapipes.vercel.app

11–20 of 164 posts

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#11
post #10

Is there always a single possible solution ? (I did a bunch of small ones and always found a solution pretty quickly)

if the pipes are cut from a Spanning Tree connecting all the hexagons (like the one you witness once you have solved), then yes, for those give pipe pieces, there should be only one solution.

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#12
post #5

My first, a 5x5, in 3:08 It was fun, but on the edge of annoying, which seems appropriate.

2:37 for me, and I'm not terribly good at puzzles. I was getting frustrated and then it just kind of clicked. The color changing is incentivizing. I found it fun in general; might have to do a couple more...

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#15

Captivating! So, while generating the puzzle, you are essentially creating a random Spanning Tree for the given nodes (hexagon) arrangement? Then you randomize each pipe piece's direction within a hexagon? What algorithm are you using for it Spanning Tree? I have been working on Maze Generation[0] and found randomized Prim's, Kruskal's to be useful for Spanning Tree creation but the good old Depth First Search increa…

Well the way I wrote my pipes solver was to keep a set of possible orientations of every tile and gradually remove impossible options by using border conditions and some heuristics like avoiding islands and loops. And when this doesn't turn up any new info I resort to depth-first search.

The generator basically does the same but every tile starts out with a full set of possible orientations - every rotation of every tile shape (there are 62 I think). I remove some orientations due to border conditions, then pick a random possible orientation for some tile and so on till the board is filled. There usually is some backtracking involved.

This isn't terribly efficient and can get stuck for quite long when generating large puzzles. I actually want to look into adapting maze generation algorithms for creating these puzzles, so thanks for the link, I'll check it out.

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#16
post #13

What are the green/red lines that appear when you click the junction between two hexes? (really fun game btw, I will have to return to this later. I'm looking forward to sharing this with my 8 year old who's fascinated with logic puzzles.)

Those are edge marks, they let you mark some edges as "definitely a wall" or "definitely a connection". It sometimes helps in harder puzzles).

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#17
post #6
post #3

Wow! What fun. You have to make this a phone/tablet app...

Glad you liked it! I actually play it often on my phone, it's workable when zoomed in. An app would be nicer surely but I don't know how to build those =).

You 100% need to figure that out, because this is _really_ good and there’s money to be made here. Make sure you’re the one who makes it.

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#18
post #10

Is there always a single possible solution ? (I did a bunch of small ones and always found a solution pretty quickly)

All puzzles on the site have a unique solution At least my solver thinks so)). Configurations with multiple solutions are possible, but I weeded those out when generating.

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#19
Love it!

I first played the version of this with squares on a Palm Pilot and that was a long time ago. I was even looking for that version for my iPhone the other day but was drowning in other random games (and little network tools) until I gave up.

It shouldn’t take much effort to turn it into a PWA, so then people can use it just like an app. I already saved it to my Home Screen and would certainly play this as a daily puzzle, just like Wordle. Keep up the great work.

Re: Show HN: Pipes puzzle (a.k.a. Net) on a hexagonal grid

#20

Captivating! So, while generating the puzzle, you are essentially creating a random Spanning Tree for the given nodes (hexagon) arrangement? Then you randomize each pipe piece's direction within a hexagon? What algorithm are you using for it Spanning Tree? I have been working on Maze Generation[0] and found randomized Prim's, Kruskal's to be useful for Spanning Tree creation but the good old Depth First Search increa…

Well the way I wrote my pipes solver was to keep a set of possible orientations of every tile and gradually remove impossible options by using border conditions and some heuristics like avoiding islands and loops. And when this doesn't turn up any new info I resort to depth-first search. The generator basically does the same but every tile starts out with a full set of possible orientations - every rotation of every…

I see. Amazing work you have done! This game is enticing.
Post reply on HN