gereleth / hexapipes

Hexagonal pipes puzzles
https://hexapipes.vercel.app/hexagonal/5
MIT License
186 stars 19 forks source link

interesting and useful bug in etrat #94

Closed gordonwoodhull closed 1 year ago

gordonwoodhull commented 1 year ago

Etrat is my go-to puzzle these days. I can reliably solve a 10x10 in "proofs mode", working from the edges in, until I only have to guess maybe 4x4, and I've kind of learned how to move the loose edges around (although I don't understand what I'm doing in a rational way).

I've noticed an interesting quirk. I think it only affects this grid, and only at the bottom. If you have the assistant on and you press and hold in order to start locking, and then keep dragging outside the grid, it will spin any adjacent tiles until they make sense, i.e. they will not point outside anymore.

This is actually super useful for those little triangular "v"s.

I kind of wish this worked everywhere. I haven't looked at the code to figure out why it's doing this, but I like it.

gereleth commented 1 year ago

Haha, this is a bug in how etrat's which_tile_at handles empty tiles. It should return index -1 if the tile is empty and it does so for upward triangles but not for squares or downward triangles)). So you're basically locking empty tiles which causes their neighbours to rotate :laughing:

I'll fix this soon so please don't get too attached to this feature.

gereleth commented 1 year ago

It looks like I already fixed this while refactoring grids in the cubes branch. Shouldn't happen again now that it's merged. Thanks for the bug report anyway :hugs: