Crossword intersections: grid, bends or curves
My crossword generator gave one crossing per word. I measured grid, bent and curved words over 1,000 levels; curves took it from 3.96 to 5.66 per board.
Contents
Picture Word Connect is a crossword where every answer is clued by a picture. You trace letters on a wheel, and each word you find drops into the board next to its picture. The board used to be a normal grid: words run across or down, and two words cross on a shared square.
I wanted more pictures crossing on one board. Crossings are what make a crossword feel like one puzzle and not five separate words, and my boards had very few. So I asked Claude Code a design question — could the board be curves instead of a grid? — and got numbers back before any opinion. This is how that went, including two answers that turned out wrong.
Why a grid crossword stops at one crossing per word
The first measurement was over all 1,000 English levels the offline generator had built. A board held 4.79 pictures and 3.96 crossings on average. That is almost exactly one crossing per word: the minimum needed to join the words into one connected shape. Only 16% of boards had a loop, meaning a word crossing more than it needed to just to stay connected.
The obvious suspect was the search, so I tested it. Re-running the layout 150 times per level on 40 levels, and keeping the layout with the most crossings, moved the average from 3.42 to 3.50. A better search does almost nothing.
The reason is geometry. On a grid, closing a loop needs four words whose letters match at four corners, inside a board of about 8×9 squares, with a picture square in front of every word. Ordinary picture names almost never line up like that. With straight words, a crossword generator is close to its ceiling at one intersection per word.
The cheap answer I nearly missed
Before changing any geometry, I measured what happens if the generator is simply asked for one or two more pictures per board. That turned out to be most of the gain:
| English, 1,000 boards | Pictures | Crossings | Boards with a loop |
|---|---|---|---|
| Today | 4.79 | 3.96 | 16% |
| Straight, +1 picture | 5.86 | 5.08 | 20% |
| Straight, +2 pictures | 6.41 | 5.63 | 21% |
So "straight words have hit their limit" was only half true. Crossings per word were stuck; crossings per board were not, because more words means more joins. That needs no new code and no new art, and it should be the first thing anyone in this position tries.
It does not give loops, though. 20% is barely more than 16%, and loops were what I was after.
Bends
The next idea kept the grid and let each word turn once, in an L. The letters stay on squares, so a crossing is still one shared square, and the board can draw the corner rounded to look curvy. My shared crossword-layout package learned to store a bent word, search for layouts with bends, and validate them. With bends switched off it still rebuilt all 2,000 existing levels byte for byte, which is what let me trust the comparison.
The first numbers looked good. Bends with one extra picture gave 5.35 crossings and 43% loops, against 5.08 and 20% for straight words.
Then I regenerated every level and looked at the result. A bend can lay one leg of a word right alongside another word, and every row and column still reads as a single entry, so the existing checks passed it. What it leaves is a 2×2 square of letters. I counted them: 189 English boards and 220 French boards had one. The old straight levels had zero. Level 1 was an example — CAR went down to its A, then turned and ran under CAP.
Forbidding a 2×2 square around a bent word took most of the gain away:
| English, 1,000 boards | Pictures | Crossings | Loops | Words bent |
|---|---|---|---|---|
| Straight, +1 picture | 5.86 | 5.08 | 20% | 0% |
| Bends, +1 picture, squares allowed | 5.86 | 5.35 | 43% | 9% |
| Bends, +1 picture, squares forbidden | 5.86 | 5.14 | 27% | 6% |
Plus 0.06 crossings per board, for new geometry, new validation and a painted turn arrow. I dropped bends.
Curves
What finally worked was taking the letters off the grid entirely. Each letter becomes a round bead at a free position, and each word is a track running through its beads from its picture. Two words cross where they share a bead, so a crossing is still a single shared point, not two arcs that happen to meet. Any two words with a common letter can cross, at whatever angle the rules allow.
My worry going in was readability: letters from different words touching, and tangles you cannot follow on a phone. So the layout came with rules from the start, enforced by the same code that searches and validates: letters evenly spaced along a word, a limit on how sharply a word may turn, a minimum angle where two words cross, and nothing crowded or touching.
The first prototype found no layout for 15 of 40 sampled levels. Logging which rule rejected them showed that some levels could only connect through a word's first letter, or through two crossings on neighbouring letters, and I had forbidden both. The grid allows both, so I allowed them too, and every sampled level laid out. Boards were built 10 letters wide by 7 high, because the space the board gets on screen was wider than tall at every phone size I checked.
The full rebuild of 1,000 levels per language:
| Pictures | Crossings | Boards with a loop | |
|---|---|---|---|
| English, grid | 4.79 | 3.96 | 16% |
| English, curves | 5.85 | 5.66 | 67% |
| French, grid | 4.86 | 4.13 | 26% |
| French, curves | 5.58 | 5.42 | 69% |
Both curve rows include the extra picture per board from level 11, so the fair English comparison is straight words with one more picture: 5.08 crossings and 20% loops. The 40-level sample had promised loops on 98% of boards. The full run said 67%, and the full run is the number I trust. Still, two boards in three now loop, where one in six did.
Three costs showed up:
- Rebuild time. The grid generator built a language in about a minute. Curves took 27 minutes for English alone, and French longer. This is the price of generating levels offline, and the reason it stays offline.
- Fewer distinct pictures. Busier boards reuse pictures more. With the extra picture per board, English went from 523 different pictures to 443, and 77 picture files dropped out of the app.
- Free letters. Once curves could cross that much, I raised the floor to six words per level, and one app test failed: it assumed every word needs its own trace. On a curve board a word can be completed entirely by the words that cross it. The test was wrong.
Making it readable took longer than the geometry
The geometry took an afternoon. Making it look right on a phone was most of the work, and almost every round was me looking at the emulator and saying no.
Per-word colour came first. With every track in the same gold I could not tell where one word ended and the next began. The track art was repainted white and tinted per word in code, and in the end it became a narrow chevron band — white and the word's colour alternating — so the reading direction is in the track itself.
Spacing was next. Neighbouring letters were allowed anywhere from 0.9 to 1.4 letters apart, and the uneven gaps looked messy. Tightening that to an even range meant a rebuild, and the measured result was neighbours 1.43–1.57 apart and unrelated letters at least 1.66 apart. The board grew to 14×13 letters to fit it. A full rebuild then took about 8 minutes per language, down from the 1–2 hours that six- and seven-word levels had been taking on the old 10×7 board.
Then straightness. Smoothing the drawn curve was not enough on its own, because the letters themselves zigzagged. So the generator got a straightening force that pulls each letter toward the line through its neighbours. The average bend at a letter went from 31° to 7°, and letters sitting nearly in line with their neighbours went from 16% to 74%. It cost about 0.7 crossings per board (6.7 to about 6) and made letters about 8% smaller on a small phone. A second force, to make every word start square to the board, broke about one board in ten even at its gentlest setting, so it stayed out.
Where the pictures were the problem
Pictures were the part I kept losing. Each level stored where every letter sat, but the pictures were placed later, at run time, by a search that looked for free space around letters it could not move.
When I asked for bigger pictures, the first proposal was to regenerate every level with more room around each one. I stopped it: I wanted a drawing change, not a change to the level data. What followed was a series of drawing fixes. Pictures grew into free space, then overlapped tracks, which made it unclear which letters belonged to which picture. Pictures then kept clear of everything, and shrank. Every picture on a board was drawn the same size, so one cramped picture set the size for all of them, and a single tile pressed against an edge made a whole board's pictures small.
After enough rounds of that I had three Claude Code agents propose a layout design independently: one from art direction, one as a single mathematical optimisation, one as a pipeline that generates several layouts per level and keeps the best. I added my own proposal: a 2D physics simulation with no gravity, where letters and pictures are both bodies with padding, pushed apart and pulled together until they settle.
All three agents reached the same diagnosis without seeing each other's work. Two systems were fighting. The generator placed letters without knowing pictures are squares, and the drawing code hunted for picture spots without being able to move a letter. The generator was already a gravity-free force-directed simulation, but it only moved the letters. Every proposal fixed it the same way, by making pictures real bodies of fixed size inside the offline generation, so the game only scales and draws.
I took my simulation with the pipeline agent's ranking: each level tries several layouts and keeps the one that draws largest. On a 40-level preview, small phone:
| Pictures (median) | Letters (median) | Boards showing "not enough room" | |
|---|---|---|---|
| Before | 42 px | 17 px | 7 of 40 |
| Simulation, same spacing | 44 px | 16 px | 20 of 40 |
| Simulation, letters 25% closer | 48 px | 17 px | 3 of 40 |
Across all 1,000 levels per language, the final sizes:
| Phone | Pictures before | Pictures after | Letters before | Letters after |
|---|---|---|---|---|
| Small (360×640) | 41 px | 48 px | 16 px | 17 px |
| Tall (412×915) | 52 px | 60 px | 20 px | 22 px |
So the fix for picture size was in the level definition after all, the place I had refused to touch. The opening-layout post on a different game ends on the same warning sign: the one part of a level its data does not describe is the part decided by whatever code runs first.
It was not free. Letters on a small phone ended at 17 px against 24 px at the start, because the padding and the picture room take that space. The game shows a "not enough room" notice when letters fall below a readable minimum, and after the rebuild that notice appeared on 12% of English and 21% of French boards on a 360×640 screen. The smallest board there draws letters at 18 px per letter of spacing, so I lowered the minimum from 22 to 18 px and the notice no longer appears at that size. That is a judgement about readability I made by eye, not a measurement.
How it was checked
- Tests. 447 game tests pass, including validation of every level with its pictures, and lint is clean. The layout package's own tests pass alongside its release checks.
- Device. The first curve build passed the emulator scenarios that win a level, trace a word, use a hint and play an eight-letter wheel. One timed out once on a heavily swapping emulator and passed on rerun. Later builds ran a scenario or two when the emulator allowed it; otherwise I installed them and checked by eye, because the test driver often could not start on it — the subject of a separate post.
- CI. The first release of the layout package failed on GitHub with all 38 of its tests passing:
Error: [vitest-worker]: Timeout calling "onTaskUpdate". The test file had taken 80 seconds on the runner, and the new picture-layout test 29 of them. I cut that test to 4 seeds of 4 words, it ran locally in 0.6 seconds, and the re-tagged release passed.
Two things remain unproven. Levels holding fewer words than their target went from 89 to 91 in English and 99 to 101 in French. An older rule accounts for most of those, but I cannot rule out that the extra two per language came from a layout failing; proving it means another 40-minute build. And none of this says whether players solve the curve boards faster or slower. Nothing has measured that yet.
What I would do again
Measure the ceiling first. The 150-try experiment ran before any code changed, and it killed "a better search" as an idea before anyone wrote one.
Count the ugly cases, not just the averages. Bends looked like +0.27 crossings until a count of 2×2 squares found one on 189 boards.
And put everything the board depends on into the generator. Every round I spent fitting pictures in at run time was a round spent arguing with a layout that had been decided without them.