I found the optimal solution for day 8 by hand, that was fun!
My algorithm, by hand, was as such:
1. Start with the smallest possible valid solution (1)
2. Expand slowly, and each "step" (like, moving a wall or two around to "obvious" spaces) must be a valid solution (this brings you to 40-60 score, depending on your choices, on day 8). Continue to step 3 once you can't see anything obvious.
3. Look at possible places where you could expand, but need 1 more block. You'll find one eventually.
4. See if you can spare any walls anywhere, using diagonals for example. If so, place the solution from 3 and go to 3 (repeat). If not, go to 5.
5. Count or estimate the squares gained by doing your improvement from 3. See if you can reduce your score by less than that, pessimizing your solution, to gain 1 wall. Once you've found one, go to 3.
That got me to the optimal score within 15 mins or so.
I think you should change the cherries to a battery and call the game Correct Horse Battery Stable.
This is nice, I enjoyed it. Was a couple points off the optimal score for day 8 but when I clicked "Show optimal" I couldn't then go back to see mine to compare. Either way, stretched the brain a bit.
Only nit: fix the walls. They take up one and a half spaces so are confusing, and they're sci-fi steel with flashing red lights. Turn them into one-square-only fences. You use fences to enclose horses, not raptor walls from Jurassic Park.
Score init should say N/EIGH instead of N/A, otherwise great.
I am curious on how you would algorithmically find the optimal solution for this kind of problem for much bigger grids. I wanted to do some seed finding in Factorio for the same exact problem using the generated map images, but never found a good solution that was fast enough.
I would like to be able to compare/switch optimal with my solution with single click.
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/
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
clone it and run
make init // make web
Each time I see a `horse` domain, particularly for entertainment, I remember to `traceroute bad.horse` and smile again.
I imagine you went searching for domain names and came up with this? I resisted clicking on this top story all day because I thought "how good could that be? "enclose horse" what is that?" Yet, the experience was genuine-slow-forming-smile-of-understanding. This is really good.
I did Day 8 - I don't know if Perfect means I got the most optimal score, I do show up at the top of the graph.
https://enclose.horse Day 8 PERFECT! 100%
Cool game, but I don't like how you get only one chance. Even returning to the page, you can't try again to beat your previous score. No replayability value at all.
Which came first -- the game or the domain name?
lots of fun! the fact that the walls spill over the square boundaries is very annoying though, i would love to have an option to just make a wall a filled in square without the 3d effect.
This is a very cool and enjoyable game. I'd be really interested in knowing what framework/library was used to make it. I inspected the source and can see the game is done on canvas, but can't work out more than that.
Looks like some people have discovered the first "accidental" game mechanic: The horse can walk over cherry fields, but the player cannot place walls on them - so if a level designer places cherries strategically, they can create unblockable paths.
Right now, this is only used for troll levels, but I wonder if you could also use it for some actual puzzles.
Nice game! Out of curiosity, are the daily levels built by hand or algorithmically? Is there some way to measure their difficulty computationally, other than just trying to do it yourself or seeing how many people get a perfect score? I'm also working on a grid-based browser game and both those questions have come up for me, I'm keen to see how other people tackle it.
Ton of fun! Was interesting to see how my strategy evolved as well. I started out trying to make a large pen, but quickly realized that wouldn't work, so I made a small pen and then started moving it out. This allowed me to see individual optimizations and try alternatives. Even at the end, about to hit submit, I wasn't sure my solution was optimal, but ended up with the optimal sizse-86 solution for today's challenge. Will try again tomorrow!
I think this problem is called the maximum-weight closure and can be solved as max flow. You want to find a cut between source (horse) so they were no out-going edges not in the cut (escape routes).
My 10 year old loves this game. He started playing it Wednesday or Thursday of last week and basically all of his screen time. Both trying to optimize and the level design scratch an itch that few games do
just vibe-coded an optimizer for this game that takes in the screenshot of the grid and the number of walls as input, and spits out the optimal wall configuration (supports cherries too!)
algorithm:
1. infer grid dimensions
2. color histogram analysis to designate grasses, water, cherries and horse
3. apply mixed-integer linear programming to determine optimized wall placements
4. profit!
Usability, i'd like either a 'save/restore state' button, or a 'restore current best'. Right now, experimenting after finding a solution seems like a punishment if I can't recall exactly what I did to hit my rolling 'best'. Good game though!
I love it! I miss a way to see the reference solution, would be nice in order to learn. Or maybe get a hint.
> Horses can't move diagonally or over water.
Ah the famous spherical horse in vacuum
I'm pretty sure the author got the domain first and then designed an (awesome) game around it.
This is surprisingly similar to a subset of the ARC II puzzles.
The collected answered could probably be used to teach an AI to approach this type of problem thereby gaining some of the cognitive biases that humans have, which is exactly what you want in some cases: An AI that generates human like solutions to hard problems .
Nice game, I'm going to sink some time on these! Got 86 points today
https://enclose.horse Day 8 PERFECT! 100%
Love this! I feel like this would get a lot of traction as a mobile app. It's a perfect "I've got five minutes free" game.
Doesn't feel outrageously difficult to put inside a webview?
Does each day's challenge come out at a certain time in your local timezone? I have a friend who is seeing day 9 when I can only see day 8. I'd request having new daily maps come out at a consistent global time for the purpose of competing with friends who live in different timezones.
A very fun game - it took quite a bit of fiddling to get an optimal solution using an LLM. Interesting as I haven't tried using them for 'unique' algo problems much. And then the day 9 puzzle broke my original solver (I had bounded areas that were unreachable to the horse so didn't actually score). Will be interesting to see whether the solver works on day 10.
It would be interesting to be able to change the wall budget for each puzzle to add some variation (with a max limit).
Wife’s comment: “Cherries? It needs to be an apple.”
Nice puzzle! But I'd like a button to go back to your most optimal solution so far: it's tedious to try other options but then have to convert it back to your better solution again...
Great little game. For the community levels, I'd suggest adding filters based on size & walls.
I'd even go so far as to deny any submission with more than sqrt(size) walls.
Enjoyed that.
Removing a block was a bit fiddly on FireFox (Floorp) due to the right click menu appearing when I tried to click on a tile.
Looking forward to tomorrows!
I expected the horse to move one tile for each block you placed. I had an elaborate plan to lure it towards one exit and then close it at the last minute... Nope!
The game dynamic feels a bit like Wordle: One puzzle per day and different solutions that you can compare with others.
I didn't realize level 1 gave me 11 (eleven) walls at first. I thought it stood for II = roman 2. Maybe use a font that makes the difference between 1 and I clearer.
Fantastic fun! My humble level contribution is here [1].
Wow, that’s a lot more challenging than it looks. I agree with another commenter that the 3d blocks look confusing - they appear to cover two spaces.
Raaarhh. Perfect solution yesterday, perfect solution today! I'm really on a roll. Love love the game
https://enclose.horse Day 8 PERFECT! 100%
This is a really fun game. And I just realised you can make your own levels!
Is there guaranteed to be a solution that encloses the cherry? Is Day 8 the first day to have a cherry?
So fun!
I wonder how the wiggle animation is implemented in for the buttons and modal.
It's like ChuChu Rocket! + JezzBall; two of my favorite games!
Very cool game. Immediately reminded me of pathery, which I can also recommend to everyone who enjoys this.
Nice game! I could only play one game but wish I could play previous days' games as well
Seeing tile animations immediately reminded me of Godzilla 2: War of the Monsters on NES.
Great game, I love it! I hope the author is collecting juicy analytics. They would be useful if they ever want to bundle 100 levels in order of difficulty and release this as a Steam game (which I would absolutely buy!)
I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no benefit. It’s subconsciously confusing to see a gate I place in one cell move to occupy pixels in the cell “above” it.
I look forward to future days introducing new mechanics as well. Can I suggest a few, based on dynamics?
- Food! The horse moves on every turn towards an attractor. Have a hay bale / giant sugar cube in one corner fall off the back of a truck / helicopter :) Horses start out dumb and move directly towards the goal before backtracking. Smarter horses path find the shortest route to the goal.
- Goals! Now that the horse is moving, get the horse into a static horse box / cattle pen cell by strategically placing fences so that the path it takes towards the food involves walking onto the goal square.
- Floods! Water encroaches from the edges on a turn by turn basis. Not only do you have to contain the horse, you also have to hold back the flood.