gereleth / hexapipes

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

Replay button #105

Closed gordonwoodhull closed 9 months ago

gordonwoodhull commented 9 months ago

Hi @gereleth! We were chatting about recording videos of solve strategies, so I started experimenting with a "replay" button. The advantage is it doesn't record the time spent thinking. (Also I think it's better not to record the panning and zooming.)

I was surprised how easy this was to implement.

Code on my replay branch is rather rough, but it basically works. Preview here: https://penrosepipes-git-replay-gordonwoodhull.vercel.app

Here is a video of a partial solve of a trihexa in "proofs mode":

https://www.youtube.com/watch?v=FS926PZWwPI

Here's a complete trihexa solve, recorded on my tablet, where I prefer to play:

https://youtu.be/hpJTyRG_Y2k?feature=shared

Would be glad to clean up this code you're interested.

Known bug: if you click replay twice it goes haywire replaying every move twice!

gereleth commented 9 months ago

This looks somewhat similar to the undo feature I worked on. And I just realized I never published that branch...

I have this video of a full undo/redo of a puzzle: https://x.com/gereleth/status/1706761417838231581

But I got bogged down trying to come up with how zoom/pan should be handled when undoing and never finished it.

Regarding solve videos I think it's more interesting to watch a sped up actual solve =). I made this recording for comparison (3x my actual speed). I think the cursor hovering around makes it more obvious where your attention is so the process is easier to follow.

https://github.com/gereleth/hexapipes/assets/6080076/1ba907bf-7009-460f-9f72-e7b72a851c64

gordonwoodhull commented 9 months ago

Undo/redo would be nice! IMO zoom/pan are orthogonal & should not be put in the history, but that's just my opinion.

Huh, yeah the cursor is nice on solve videos. I only play on tablet, and I spend a lot of time just looking for things, so I wouldn't record that way.

Oh well.