Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Generating Unique-Solution Kakuro Puzzles and Grading Them by Solving Technique

Most online Kakuro (Cross Sums) generators either serve a tiny static pack or generate grids without proving uniqueness—which leads to frustrating late-game guessing. While building Kakuro Club , I wanted every generated grid to satisfy three strict invariants: Mathematically unique solution (verified before a puzzle is ever served). Difficulty graded by human solving technique , not just grid…

Online Kakuro puzzle generators often produce a limited selection of puzzles or fail to guarantee a unique solution, leading to potential guesswork in the later stages. When developing Kakuro Club, the goal was to create every puzzle with a mathematically unique solution, grade difficulty based on human solving techniques rather than grid size, and generate deterministic puzzle codes for consistent puzzle generation and shared links.

To achieve these objectives, the constraint solver and grading pipeline operate as follows. First, precomputing all 502 valid run combinations—each run containing k distinct digits from 1-9 summing to S—takes less than a millisecond. A lookup table maps (run_length, target_sum) to a list of 9-bit digit masks, enabling quick filtering of valid combinations during the solving process.

The uniqueness verifier proves that a generated puzzle has only one solution using backtracking with Minimum Remaining Values (MRV). If more than one solution is found, the system modifies cell values or black-cell symmetries and re-evaluates. For grading difficulty, a separate human-style solver attempts to solve each unique grid using various deduction techniques: Easy (one-way sums and single-candidate intersections), Medium (cross-run candidate elimination), Hard (subset/naked-pair eliminations), Expert (multi-run sum parity), Hard (longer elimination chains across multiple runs), and Fiendish (requiring bifurcation). The highest technique tier required to finish the puzzle determines its published grade.

Finally, to ensure clean black-and-white printing, the Printable Kakuro sheet generator sets print-color-adjust: exact and renders clue diagonals as inline SVG triangles within crisp CSS grid cells, resulting in a lightweight (~39 KB HTML) puzzle generator.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

The client disconnected. What should the meter charge?

The chat has stopped. The amount is still pending. A support agent asks a chat app to summarize a report. Halfway through the first paragraph, she realizes she picked the wrong file. She clicks Stop.

  • $0.04 charge pending after chat session disconnect
  • OpenRouter charged $0.04 for work done prior to disconnect
  • Support must pay $0.01 to complete $7.40 total bill

Ted Cruz Blames China for Data Center Water Fears: 'You're Being Lied To'

The Texas Republican claimed China-backed influence operations have helped rapidly shift public opinion against data centers.

  • Ted Cruz claims China funds misinformation about data centers' water consumption.
  • Texas hosts over 400 AI data centers consuming 25 billion gallons of water annually.
  • Cruz argues newer data centers use less water than golf courses.

More from Friday 27 November →