RC RANDOM CHAOS

Sunflowers: A Minesweeper Inverse Whose Solver Guarantees the Difficulty

· via Hacker News

Original source

Show HN: Reverse Minesweeper

Hacker News →

Sunflowers is a browser-based logic puzzle billed as a ‘reverse Minesweeper’: instead of avoiding hidden mines, you plant flowers to satisfy numeric clues. Its notable trick is that difficulty isn’t guessed at—every generated grid is run end-to-end by the same deduction engine that also drives the in-game hints. That solver always takes the simplest available move, like a careful human, and records which reasoning techniques the grid actually forced it to use, so a grid’s rating reflects the logic it demands rather than surface features like size.

The engine recognizes five escalating techniques, and each grid is named for the hardest one it requires: a single clue settling its own squares (Easy), subtracting one clue from another when their unknowns nest (Medium), min/max bounds on overlapping regions (Hard), ‘what-if’ forcing chains that plant a hypothetical flower and watch a clue break (Extreme), and, beyond that cap, longer chains plus an ‘either-way’ technique borrowed from Sudoku coloring, where two surviving hypotheses agree on the same square (Insane). A 0–100 score places each grid within its tier’s non-overlapping band, weighted by sub-metrics like chain depth, so a higher number is always genuinely harder.

The generator is tunable: sliders set minimum requirements—so many subset moves, a chain of a given length, and so on—and each request tries up to 90 candidate grids, serving the closest match with a flag when nothing fits. Supporting rules govern placement of zero-clue tiles per tier, and estimated solve time is summed from per-technique cost weights defined in the source. The result is a self-verifying puzzle generator that can promise a specific kind and depth of reasoning, an unusually rigorous approach for a hobby game.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.