Enclose Horse
enclose.horseI took a screenshot of my solution and the optimal one - and then I could compare like this.
Video: https://www.youtube.com/watch?v=-r6CnPzTXKE
Damn, the good old days when games didn't have loot boxes, ads, etc...
https://enclose.horse Day 8 PERFECT! 100%
[0] I'm assuming, possibly quite wrongly, that there's only one optimal solution per day.
window.__LEVEL__ = null; window.__DAILY_MODE__ = true; window.__DAILY_LEVELS__ = [{"id":"FswXDo","date":"2026-01-06","dayNumber":8,"optimalScore":86},{"id":"6UV4Yw","date":"2026-01-05","dayNumber":7,"optimalScore":95},{"id":"VfWi_1","date":"2026-01-04","dayNumber":6,"optimalScore":77},{"id":"CNtGPI","date":"2026-01-03","dayNumber":5,"optimalScore":116},{"id":"tnLvlG","date":"2026-01-02","dayNumber":4,"optimalScore":51},{"id":"Qn9vLs","date":"2026-01-01","dayNumber":3,"optimalScore":74},{"id":"Kj7mXp","date":"2025-12-31","dayNumber":2,"optimalScore":90},{"id":"E03KkY","date":"2025-12-30","dayNumber":1,"optimalScore":68}];
EDIT: the view optimal button appears after submissionJust show all the different levels at once.
And when there were sites with unlimited Wordle, I played a few in a row.
On the internet, unlike with newspapers, you're not limited to how many levels/games you can make per day. Making it once per day doesn't make any sense whatsoever. It's condescending to the users and feels like a power trip.
condescending (adjective): having or showing an attitude of patronizing superiority.
I don't really see how a once-a-day puzzle is condescending, unless it's a "You can't be trusted to regulate yourself so I'll do it for you" type thing. Adding a dictionary definition like above, however, probably is condescending :)
But I like the one-a-day format because, as other comments have said, you can spend an entire day with just one puzzle feeling important (relative to things that are important).
Ironically, that's what I initially liked about the daily puzzles like Wordle: they forcibly prevented you from sinking too much time into them. It was sort of like, "hey here's something cool, and I'm going to make sure it's a positive addition to your life by preventing you from succumbing to your own addictive impulses". You could call that condescending or infantilizing, but to me it's just part of the look and feel of a thing. Especially if the author isn't charging money, they get to use whatever tools are at their disposal to craft the users' experience of it. Wordle Over And Over Again is a different game than Wordle Once Daily. (And WOAOA done properly would probably have a progression of difficulties, or themes, or something, whereas WOD makes more sense with pure randomness.)
I love Wordle but I found it unplayable when I used that Wordle archive site to play infinite games since there was no reason to think deeply about the 10th+ round I was playing in one sitting.
See
https://gist.github.com/Macuyiko/86299dc120478fdff529cab386f...
Like the other comment suggested, running a loop where you keep adding constraints that eliminate invalid solutions will probably work for any puzzle that a human would want to solve.
Score: 7
~~~~~~
~····~
~·~~·~
.#..#.
......
..#...
.#H#..
..#...
However, I think that you do not need 'time' based variables in the form of reachable(x,y,t) = reachable(nx,ny,t-1)
Enforcing connectivity through single-commodity flows is IMO better to enforce flood fill (also introduces additional variables but is typically easier to solve with CP heuristics): Score: 2
~~~~~~
~....~
~.~~.~
......
......
..##..
.#H·#.
..##..
Cool puzzle!You can more precisely track flows and do maximization with ILP, but that often loses conflict-driven clause learning advantages.
Note that traditional SAT and SMT solvers are quite inefficient at computing flood-fills.
The ASP specifications it uses to compute optimal solutions are surprisingly short and readable, and look like:
#const budget=11.
horse(4,4).
cell(0,0).
boundary(0,0).
cell(0,1).
boundary(0,1).
% ...truncated for brevity...
cell(3,1).
water(3,1).
% ...
% Adjacent cells (4-way connectivity)
adj(R,C, R+1,C) :- cell(R,C), cell(R+1,C).
adj(R,C, R-1,C) :- cell(R,C), cell(R-1,C).
adj(R,C, R,C+1) :- cell(R,C), cell(R,C+1).
adj(R,C, R,C-1) :- cell(R,C), cell(R,C-1).
% Walkable = not water
walkable(R,C) :- cell(R,C), not water(R,C).
% Choice: place wall on any walkable cell except horse and cherries
{ wall(R,C) } :- walkable(R,C), not horse(R,C), not cherry(R,C).
% Budget constraint (native counting - no bit-blasting!)
:- #count { R,C : wall(R,C) } > budget.
% Reachability from horse (z = enclosed/reachable cells)
z(R,C) :- horse(R,C).
z(R2,C2) :- z(R1,C1), adj(R1,C1, R2,C2), walkable(R2,C2), not wall( R2,C2).
% Horse cannot reach boundary (would escape)
:- z(R,C), boundary(R,C).
% Maximize enclosed area (cherries worth +3 bonus = 4 total)
#maximize { 4,R,C : z(R,C), cherry(R,C) ; 1,R,C : z(R,C), not cherry( R,C) }.
% Only output wall positions
#show wall/2.Therefore, like a good little llm bitch that I have become recently, I straight away went to chatgpt/sonnet/gemini and asked them to compile me a list of more such "whatever this is known as". And holy cow!! This is a whole new world.
My ask to HN community: any good book recommendations related to "such stuff"? Not those research kinds as I don't have enough brain cells for it. But, a little easier and practical ones?
Thanks..
1. Symbolic reasoning
2. SAT/SMT/ASP
3. pre-machine-learning formulations of AI
- https://www.cs.utexas.edu/~vl/teaching/378/ASP.pdf
It starts with basics of using ASP and gives examples in clingo, not math.
The Potassco book is more comprehensive and will help you understand better what is going on:
Things I don't like include that it's more dense, doesn't use clingo examples (mostly math-style examples so you kind of have to translate them in your head), and while the proofs of how grounding works are interesting, the explanations are kind of short and don't always have the intuition I want.
I still think this is the authoritative reference.
The "how to build your own ASP system" paper is a good breakdown of how to integrate ASP into other projects:
- https://arxiv.org/abs/2008.06692
The Potassco folks are doing amazing work maintaining these tools. I also wish more people knew about them.
[1] https://github.com/spack/spack/blob/develop/lib/spack/spack/...
Is NP hardness proven for just planar graphs? Those are closer to the 2D grid, but still slightly more general. All I could find was a reduction to densest k subgraphs, but Wikipedia tells me that whether that problem is NP hard for planar graphs is an open question.
To be clear, I would be very surprised if the problem turns out to be _not_ NP hard, but there is no trivial equivalence to min cut in general graphs to show that it is.
It might be polytime on planar graphs, but that would be surprising.
For example, in a grid like this:
..####
.....#
#.#..#
#...H#
######
A single wall placed (i.e. vertex removed) can block two edges, and it's not obvious what graph transformation can turn that into a single edge.There is a standard construction for going between vertex and edge cuts.
Great, now I've been double nerd-sniped - once for the thing itself and another for 'What would an optimiser for this look like? Graph cuts? SAT/SMT? [AC]SP?'
The Leetcode version of this is "find articulation points", which is just a DFS, but it's less general than what is presented here.
https://cs.stackexchange.com/questions/176005/how-to-remove-...
I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no reason in that 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.
I think it should go up, otherwise it doesn't look like a wall. It would look like something the horse can step on and run over. For the water it makes sense to be flat flat and that the horse doesn't want to touch it: it is water-shy.
Great game! Feature request: add a button that shows my submitted solution. I'd like to be able to compare it with the optimal solution (so it'd be nice if a single tap could toggle between my submission and the optimal).
I also wonder if making it GPL and submitting to various *NIX distros would be best. Then it may need to be standalone with random maps created by ML or similar.
I hope they're not. Can't we have a few things in this world that are just fun without going and sticking surveillance on them?
Please, show me a piece of software, or game, that is perfect the first time it is made.
This whole industry really needs a lesson on consent.
If I collect information on how often a coin-op Street Fighter II game is played in an arcade, while collecting no personal information, consent is not needed.
If I want to play a game and provide my feedback, the default should be that that doesn't happen unless I explicitly say it should.
Opt-out means that, by default, you're collecting metrics from my plays, until I find the means to opt-out.
trying to understand player behavior in the context of a board or video game (though there is some overlap!) is not the same as trying to understand user behavior in the context of social media or purchasing behavior - the data of both of which derive their value from being sold to THIRD PARTIES as a commodity.
being able to tune a fun little video game is not the same thing at all
But, you absolutely could make this a turn based game where the horse is trying to escape and you (playing as the farmer), work to fence it in as it meanders towards a gate.
[1] https://store.steampowered.com/app/1628610/Paquerette_Down_t...
I would have responded earlier, but I wanted to actually implement something you suggested: different walls. Alternative wall sprites, which don't occlude other tiles so much, are now live and can be adjusted in the settings.
Re: analytics, the only serious plans I had were to use the daily level histograms to adjust difficulty. The idea of taking some levels and releasing them as a standalone game is tempting, but I wonder if doing this type of puzzle over and over again might get tedious? That's one of the reasons I thought it would work better as a daily game. Let's see how it's doing in a few months.
I love the mechanic ideas. I think there are two big constraints on what kind of cool new features/gimmicks can be implemented though. First: if this is going to be a daily game, the new mechanics have to be intuitive enough to where somebody could figure them out their first time playing. I like the idea of cherries being misleading, and it's a fun troll-ish idea for a single player game, but it would be a mean trick if it were someone's first daily. (Then again, there's someone who's first Wordle game was probably MYRRH.) The other constraint is I have a solver that can guarantee the optimal solution is actually optimal. Some game mechanics might make this a lot harder, or even impossible.
> I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no benefit.
I also feel it would make more sense either for everything to be 2.5D or pure top down. Having appear / disappear animation is nice feedback to user though.
Other thing is that maybe the hitbox should change when the wall comes up. Now to remove it you need to press the grid, essentially the root of the wall. Unintuitive to me.
Thanks for the game, looking forward to when there is multiple horses or sheep to enclose.
1. lure the horse to an optimal point on the map.
2. trap it in a small circle of fences.
3. build part of your final wall with the remaining fences.
4. one by one, move the fences trapping the horse in place into position.
I agree! It feels off compared to the overall aesthetic of the game.
Awesome game though! Loved it.
I interpreted it as standard "top-down" RPG graphics, where the Y axis always doubles as the Z axis. As such, I didn't find it visually confusing - but it did made playing on mobile annoying, because you often end up targeting the wrong field.
This is a rather simple game to program. IMO, if you can program, take a few weekends to make your own game based on your ideas. If you can't program, your ideas will lead you to a wonderful learning project.
(jk)
I did originally try to measure the difficulty computationally by running the solver and timing it, but it didn't really line up with what humans would find difficult. Now I'm just eyeballing 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
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 .
Ah the famous spherical horse in vacuum
64 more comments available on Hacker News