gereleth / hexapipes

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

"Solved!" message appears prematurely #81

Closed gereleth closed 1 year ago

gereleth commented 1 year ago

This was reported on daily puzzles 2023-03-23, 2023-03-22, 2023-03-19. They're from the same weekly series (large wrapping board with hourglass shape). "Solved!" message appears when a few pieces are still not connected. Reports with screenshots: 1, 2.

I wasn't able to reproduce this so far. I'd appreciate a saved progress from a puzzle where this happens.

narimiran commented 1 year ago

From today's (2023-03-24) puzzle:

https://i.imgur.com/5XX7rzg.png

gereleth commented 1 year ago

That's a lot of tiles! Can you reproduce the wrong Solved message if you refresh the page and start from saved progress? And if yes then could you please share the contents of local storage item with key /daily_progress?

narimiran commented 1 year ago

Sorry, I've seen your reply only now, when I was able to correctly solve it after several false messages.

Can you reproduce the wrong Solved message if you refresh the page and start from saved progress?

Yes, I could reproduce it several times. It went something like this:

  1. Wrong "Solved!" message.
  2. I cannot move any tiles.
  3. Refresh page. Tiles can be moved again.
  4. Move several tiles.
  5. Goto 1.

And if yes then could you please share the contents of local storage item with key /daily_progress?

If that is still useful after the puzzle has been (really) solved, please tell me how to get that data.

gereleth commented 1 year ago

Daily progress is saved to the browser's local storage. So you need to open browser dev tools (usually by pressing F12 or ctrl-shift-i), locate 'Storage' tab, find 'Local Storage', then look for the key /daily_progress and copy its value.

So if this happens again tomorrow for example then these steps would help me out:

  1. Get a wrong solved message.
  2. Without refreshing the page (important) get the saved progress, paste it into a text file so it doesn't get overwritten by next steps.
  3. Refresh the page and see if you get a wrong solved message again. If yes then share the previously saved progress and what steps lead to the wrong solved message after refresh.

I'm trying to reproduce this but no luck so far. :woman_shrugging:

gereleth commented 1 year ago

I finally managed to reproduce on today's puzzle and the problem should be fixed.

The problem was with counting how many tiles need to be connected in order to solve the puzzle.

total = width * height = 529 tiles 121 tiles are empty need to connect 529 - 121 = 408 to win

But at some point I made the grid report its total already excluding empty tiles. So there was a double subtraction of empties and if you had an island of at least 408 - 121 = 287 tiles then that counted as a win.

You could finish a puzzle without a premature solved message by never creating big islands so reproducing this wasn't trivial =).