just vibe-coded an optimizer for the game enclose.horse 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.0. register game mechanics as optimization constraints (cannot place on cherries, cannot move over walls and waters etc.)
3.1. apply mixed-integer linear programming to determine optimized wall placements
dyigitpolat•1d ago
algorithm:
1. infer grid dimensions
2. color histogram analysis to designate grasses, water, cherries and horse
3.0. register game mechanics as optimization constraints (cannot place on cherries, cannot move over walls and waters etc.)
3.1. apply mixed-integer linear programming to determine optimized wall placements
4. profit!
try: https://dyigitpolat.github.io/enclose-horse-solver
source: https://github.com/dyigitpolat/enclose-horse-solver