One of the four daily puzzles in my browser game is TANDEM. It's a 6×5 grid, and one arrow press moves two couriers at once. A courier that hits a wall or the edge stays put, and if both would land on the same cell or swap places, neither moves. You have to get both onto their goals.
Hand-placed goals tend to give levels that are either trivial or have a silly 3-move shortcut, so the generator works the other way round:
- Seeded RNG from the date, then place 7–9 walls and reject the layout if the open cells aren't connected.
- Pick two start cells.
- BFS over the pair state (cell A, cell B). That's only 30×30 = 900 states, so a full search from the start is basically free.
- From everything reachable, keep only pairs whose shortest path is 9–15 moves and where both couriers end up off their start cells. Pick one of those as the goals.
- Par is simply the BFS distance, so the "optimal" score is exact and not a guess.
Because the goals come out of the search, every puzzle is solvable by construction, and difficulty is controlled by one number (path length) instead of my intuition. The weak spot: path length isn't the same thing as perceived difficulty. Some 10-move layouts feel harder than 14-move ones because the trick is moving "into" a wall on purpose so only one courier moves. One idea is to also count how many of the optimal moves are those one-courier-blocked moves.
If you've done generate-then-filter for puzzles, what did you end up measuring for difficulty?
The game is NOCTURNE ISLAND (four small daily puzzles, same set for everyone, free, no sign-up): https://nocturne-island.com/
Ha, fair. The side arrows are plain text glyphs, and that font draws them smaller than up and down. Noted, thanks for the screenshot.