feat: complete advanced Sudoku workbench

This commit is contained in:
2026-08-31 08:20:30 +02:00
parent 8ca9300ab3
commit 0a1bdc1a8c
99 changed files with 20793 additions and 923 deletions
+134 -36
View File
@@ -14,12 +14,13 @@ export function HelpDialog({
<h3>Five complementary workspaces</h3>
<p>
<strong>Play</strong> keeps values, two kinds of notes, colours,
branches, replay and elapsed time. <strong>Set</strong> edits clues
and constraints. <strong>Generate</strong> constructs and rates
bounded, seedable variants. <strong>Solve</strong> explains logical
steps and can verify uniqueness. <strong>Helpers</strong> answers
focused sum, candidate and relation questions without changing the
board.
branches, replay, guided hints and elapsed time.{" "}
<strong>Set</strong> edits registry-backed clues and runs bounded
setter-quality checks. <strong>Generate</strong> constructs and
ranks bounded, seedable single or batch variants.{" "}
<strong>Solve</strong> explains logical steps and can verify
uniqueness. <strong>Helpers</strong> answers focused sum, candidate
and relation questions without changing the board.
</p>
</section>
<section>
@@ -65,16 +66,63 @@ export function HelpDialog({
<dt>Ctrl/ + click</dt>
<dd>Highlight every placed copy of that digit</dd>
</div>
<div>
<dt>M</dt>
<dd>Toggle tap-by-tap multi-selection</dd>
</div>
<div>
<dt>Ctrl/ + + / </dt>
<dd>Zoom the board while focus is in the board area</dd>
</div>
<div>
<dt>Ctrl/ + 0</dt>
<dd>Fit the board at its default scale</dd>
</div>
</dl>
</section>
<section>
<h3>Touch, zoom and selection</h3>
<p>
Board zoom is stored in this browser. Use <strong>Pan board</strong>
before dragging a zoomed board; its strong border and status message
indicate that cell taps are temporarily paused. Stop panning to edit
again. <strong>Tap multi-select</strong> toggles individual cells
without a drag gesture and keeps one active cell for keyboard entry.
On narrow screens the entry pad stays close to the bottom edge and
respects the device safe area.
</p>
</section>
<section>
<h3>Hints and solutions</h3>
<p>
Candidate legality is computed independently from handwritten notes.
Logical deductions report their premises, affected houses,
placements and eliminations. Exact search is separately labelled; it
proves feasibility or uniqueness but is not presented as a human
explanation.
A guided hint reveals where to look, the technique, its reasoning
and an effects preview in separate stages; the board changes only
after <strong>Apply this step</strong>. Candidate legality is
computed independently from handwritten notes. Controls can fill
legal centre candidates, prune invalid centre/corner notes and
optionally maintain peer notes after placements. Erasing a value
never invents candidates.
</p>
<p>
Logical deductions report premises, affected houses, placements and
eliminations for singles, subsets, intersections, fish, wings,
colouring, chains and Killer cages. Unique Rectangle is disabled
unless a completed exact search has already proved uniqueness. Exact
search is separately labelled and is not presented as a human
explanation; reaching a limit remains unknown.
</p>
</section>
<section>
<h3>Setter-quality checks</h3>
<p>
Quick analysis checks for zero, one or two solutions and can show
the cells where two completions differ. Full analysis uses bounded
deletion searches to classify givens and constraints as critical,
redundant or unknown, build a cell heatmap, or localise a
contradictory core. Optional minimality is claimed only when the
unique baseline and every required removal check complete. Per-check
and aggregate budgets are visible, and analysis can be cancelled
without turning a capped search into proof.
</p>
</section>
<section>
@@ -84,9 +132,10 @@ export function HelpDialog({
checkpoint, isolate a hypothesis, or inspect an earlier grid.
Discarding a hypothesis restores its exact starting state but keeps
the abandoned path available in replay. Replayed grids are read-only
until you return live or deliberately branch from that step. This
working history stays in the current browser session; save the
puzzle to the Library for durable puzzle progress.
until you return live or deliberately branch from that step.
Validated history is included in local autosaves and explicit
Library saves, so restoring that progress also restores its
savepoints and branches.
</p>
</section>
<section>
@@ -115,25 +164,44 @@ export function HelpDialog({
<section>
<h3>Variant and false clues</h3>
<p>
The setter supports cages, lines, pair clues, X-sums, skyscrapers,
quadruples and maximum cells. Enable Wrogn mode to make new local
clues false, or switch existing clues individually or as a batch.
Red dashed artwork and a mark identify false clues; Σ and
identify X-sum and skyscraper readings. A false multi-cell clue
often stays undecided until enough of its cells are known, so exact
searches for dense liar puzzles can be substantially slower.
The shared registry covers classic/irregular/extra regions;
diagonal, anti, disjoint and non-consecutive rules; cages, parity,
extrema and quadruples; thermo, arrow, renban, palindrome, between,
whisper, region-sum, modular, entropic, zipper and double-arrow
lines; Kropki, 5/10 and inequality pairs; X-sum, skyscraper,
little-killer and sandwich clues; clone regions and row/column/box
indexers.
</p>
<p>
Enable Wrogn mode to make a supported local clue false, or switch
existing clues individually or as a batch. Red dashed artwork and a
mark identify false clues; global house rules, extra regions and
fog are not given a misleading false mode. Fog is display-only and
can be set only with a complete solution which validates against the
current puzzle. Wrong entries reveal nothing and the trusted
solution remains in the local puzzle document.
</p>
</section>
<section>
<h3>Generation and ratings</h3>
<p>
Generation runs in a worker with explicit time and search limits. A
requested level guides clue removal; the reported rating is then
calculated independently from logical techniques, clue load and
bounded exact-search evidence. Practice mode deterministically mines
several candidates and succeeds only when the analysed solve path
contains the requested technique. A limit never becomes a false
uniqueness claim.
Generation runs in a worker with explicit time and search limits. It
supports single or deterministic batch generation, compatible mixed
families, sparse/balanced/dense local constraints and several
rotational, reflection and diagonal clue symmetries. Minimal-givens
mode reports proof or the exact unknown reason; individual
minimisation can break the requested visual symmetry and reports
that fact.
</p>
<p>
Technique profiles can require, forbid or count techniques and set
an exact hardest technique. A result is accepted only when an
independent complete logical path matches the whole profile and an
independent exact search proves uniqueness. Requested difficulty
guides clue removal; the reported 0100 rating is then calculated
from logical techniques, clue load and exact-search evidence. A
cancelled or bounded-out candidate remains a failure or unknown,
never a uniqueness/minimality claim.
</p>
</section>
<section>
@@ -142,19 +210,49 @@ export function HelpDialog({
Files, text, solving and generation stay in this browser. Compact
grids, project JSON, share fragments, supported f-puzzles,
SudokuPad/CTC inline data and supported Penpa+ long links are
decoded locally. Server short IDs are intentionally rejected. SVG,
PNG and PDF rendering also stays in the browser. Review an export
before sharing: titles, authors, rules, solutions, progress and
aid-mémoire entries may be included.
decoded locally. Server short IDs are intentionally rejected. The
compatibility check separates mapped Sudoku semantics, preserved
inert drawings, retained metadata and warnings before import. Source
identity and allowlisted drawings survive local edits and saves but
never become rules by appearance alone.
</p>
<p>
Export includes Sudoku Tools JSON/share data, f-puzzles, SudokuPad
JSON or self-contained SCL where representable, plus local SVG, PNG
and PDF rendering. Unsupported false/global semantics and visual
geometry are rejected rather than silently weakened. Review an
export before sharing: titles, authors, rules, solutions, progress,
source metadata, drawings and aid-mémoire entries may be included.
</p>
</section>
<section>
<h3>Recovery, Library and offline use</h3>
<p>
A separate debounced local autosave can restore or discard an
interrupted session, including validated bounded history, branches
and savepoints. Explicit Library projects offer title/tag search,
completion filters, safe previews and selected export, duplication
or deletion. Browser storage can be cleared independently, so export
important projects.
</p>
<p>
On a production HTTPS host, the first successful load can install a
relative-scope offline application shell. Service-worker support is
progressive enhancement: puzzle work stays local and remains usable
when registration is unavailable.
</p>
</section>
<section>
<h3>Screen-reader detail</h3>
<p>
Each Sudoku cell reports its row, column, region, value or notes,
colour, conflict state, candidate highlights and touching variant
clues. The board and aid-mémoire use real row and gridcell roles;
their keyboard instructions are attached to the grids.
Each visible Sudoku cell reports its row, column, region, value,
colour-and-pattern mark, conflict state and touching variant clues.
Candidate detail can be set to <strong>Off</strong>, concise counts,
or detailed digits without changing what is drawn. The board and
aid-mémoire use real row and gridcell roles; their keyboard
instructions are attached to the grids. Fogged cells report only
that they are obscured: hidden values, notes, clues, candidate
overlays and guided-hint steps are not exposed through board labels.
</p>
</section>
</div>