Solving the Ny Times "pips" Game with F#
Posted2 months agoActive2 months ago
github.comTechstory
calmpositive
Debate
20/100
F#Constraint ProgrammingPuzzle Solving
Key topics
F#
Constraint Programming
Puzzle Solving
The post discusses a solution to the NY Times 'Pips' game using F# and backtracking, sparking a discussion among developers about their approaches to solving the puzzle and analyzing its difficulty.
Snapshot generated from the HN discussion
Discussion Activity
Moderate engagementFirst comment
43m
Peak period
6
Day 10
Avg / period
3.8
Comment distribution15 data points
Loading chart...
Based on 15 loaded comments
Key moments
- 01Story posted
Oct 23, 2025 at 10:51 AM EDT
2 months ago
Step 01 - 02First comment
Oct 23, 2025 at 11:34 AM EDT
43m after posting
Step 02 - 03Peak activity
6 comments in Day 10
Hottest window of the conversation
Step 03 - 04Latest activity
Nov 2, 2025 at 9:19 AM EST
2 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45682501Type: storyLast synced: 11/20/2025, 12:47:39 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
I considered parallelizing my solution as well, but the problem is that it only gives a linear speedup, while the problem space increases exponentially. I decided to focus on pruning the search tree instead, and that seemed to work pretty well (after much thinking).
Presumably it's there in the separate NYT Games app, but I'd rather not install a separate app.
Does anyone know why they exclude it from the regular games section? I realize this is the silliest of all first-world problems, but still: Why?
How are you all getting the puzzles into your solvers? I just found out that the puzzles are available in JSON at https://www.nytimes.com/svc/pips/v1/YYYY-MM-DD.json
where YYYY-MM-DD is the date for the puzzle. They have past puzzles and even some future puzzles. At the moment they through 2025-11-25.
Right now I'm using a hand written text input that for example looks like this:
for the 2025-09-09 easy puzzle which looked like this: Those JSON downloads are going to make things so much more convenient!After spending an embarrassing amount of time on today's hard before I went to bed I was wondering what kind of metrics could go into analysing the difficulty of any Pips game (and which ones NYT Games uses) and whether it would be worth writing a solver to do this analysis. I was also considering an SMT or CP approach instead of backtracking as an alternative.
Edit: And after looking through the solve times in more detail, I feel vindicated that the hard for today (01/11/2025) was both a single solution and took the solver over 8x as long to find the solution. It took me longer than 8x my average, but that's besides the point...
https://www.righto.com/2025/10/solve-nyt-pips-with-constrain...
That's how many my dumb brute force solver counted for that one too, so it looks like we are all counting solutions the same way.
This raises a question.
Here's one solution to that particular puzzle
6/5(15,16) 1/2(23,22) 4/5(0,4) 1/5(2,1) 5/3(5,6) 2/5(7,8) 4/4(9,3) 0/0(17,10) 4/2(19,18) 3/3(12,11) 3/4(21,20) 5/5(14,13)
where the notation P/Q(A,B) means the tile that has P pips on one half and Q pips on the other have is placed so the P half is on square A (counting the leftmost square on the first row as 0, and then going left to right, top to bottom) and the Q half is on square B. The order the halves of a tile are given is the order they are in the puzzle specification, and the order the tiles are listed is the order from the puzzle specification.
My solver considers two solutions different if they do not produce identical strings when the solution is written in the aforementioned format.
I'm reasonably sure that this counts some solutions as different that most humans would count as the same.
For example supposed there is a 2/3 tile this is entirely inside a region that has to sum to 10. Another solution that is identical except that tile is rotated 180 degrees would probably be counted as the same solution by a human but as different by my solver.
Similarly, if there is also a 1/1 tile entirely inside that region, the 1/1 tile and the 2/3 tile could be swapped and my solver would say that is a different solution, but I think most humans would not.
How far does this go? Would a human tend to think of all permutations and orientations of a set of tiles that are all contained in the same constraint region as identical solutions?