Ken Shirriff @righto.com · Oct 18

The New York Times recently introduced daily puzzles called Pips. You place the dominoes on the grid so the numbers satisfy the labels. I solved Pips with cool software called a constraint solver. You give the constraints, e.g. "sum to 8", and it "magically" finds a solution. Let's look closer...

50 likes 4 replies

?

Replies

@pravetz.bsky.social · Oct 20

Reminds me of when I decided to solve a mobile game my wife was playing using A* - a great fun exercise! medium.com/codex/solvin...

Ken Shirriff · Oct 18

I used a constraint solver called MiniZinc. I wrote constraints for the problem: the conditions on the grid, the shape of the grid, and the values of the dominoes. A few more constraints defined how the problem works. I didn't need to write algorithms because MiniZinc solves automatically.

Michael Wood · Oct 24

Nice. I had the same idea and got it working with Google OR-Tools CP-SAT solver

Kevin Lewis · Oct 18

This is the sort of thing we did in Prolog, back in the day. There was a version of Prolog called CHIP (Constraint Handling In Prolog) that managed much of the messy under the hood stuff for more complex cases.