4 ms·
lovely, I've created a solution finder for it. 1. Do a screenshot of the grid (try to include walls as well) 2. Open https://enclosure-horse-solution.onrender
by langarus 9mo ago
lovely, I've created a solution finder for it.
1. Do a screenshot of the grid (try to include walls as well)
2. Open https://enclosure-horse-solution.onrender.com/ https://enclosure-horse-solution.onrender.com/
3. Make sure the number of walls are correct in the input (bottom left)
4. Press "Solve"
PS: It might crash as it's on the free version of render. I've added a caching layer.
Here's the github so you can run it locally:
https://github.com/langarus/enclosure.horse-solution https://github.com/langarus/enclosure.horse-solution
clone it and run
make init // make web
- langarus 9mo agoI see some of you are already crashing the server. :melting: try to run it locally if you can't get the result via render
- ronbenton 9mo agoYou caching in memory or disk? Redis or db might survive the crashes and reduce future ones
- langarus 9mo agoon disk, so basically I'm trying to save the image of a solution and reuse it if the same quiz is required. So instead of recomputing the result just return the same image.
- ronbenton 9mo agoGot it. Is that cache surviving the crashes?
- langarus 9mo agoI'd have to host it somewhere (s3?). Right now I only commit the solution png to github. OFC it's not a good option but it's free and fast.
- ronbenton 9mo agoI think Cloudflare r2 has a generous free tier. You can also technically store images in redis I think. anyways, thank you for making this, really cool!
- slashyellow 9mo agocurious question from a non-programmer - are you checking against the exact same image (i.e. hashed), or is there an easy way of trying to match an image to a very similar one you've seen before?
- flexagoon 9mo agoNot OP, so I don't know what their website does, but there is a technique called "locality-sensitive hashing" that gives the same hash for similar items instead of exactly the same ones https://en.wikipedia.org/wiki/Locality-sensitive_hashing https://en.wikipedia.org/wiki/Locality-sensitive_hashing
- g4zj 9mo agoThere is a level editor with the ability to show the optimal result for a custom level. In theory, one could recreate any official level and reveal the best solution that way. However, I haven't tried this to verify any intentional roadblocks by the developer.