Skip to content
Muneer320Public

About

Python-powered tool to craft Sudoku books where each puzzle relies on the solution of the previous one.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

LEAP

Linked Enigmas And Puzzles

Solve one Sudoku. Use its solution to unlock the next.

Python Printable PDF MIT

Open a sample book · Generate your own · How linking works

A puzzle book with a memory

Most Sudoku books are a stack of independent grids. LEAP connects them: solve the first puzzle, read selected digits from its completed solution, and carry those values into the letters on the next page. The chain continues across difficulty tiers, turning the book into one longer exercise.

Solve and collect link values Use the letters on the next page
Actual first Sudoku page with row/column link table beneath the grid Actual second Sudoku page with a, b and c replacing selected digit values

Pages from a freshly generated two-puzzle book: easy tier, seed 42. The same letter represents the same digit throughout its puzzle. Solutions are included at the back.

Print a complete book Keep the chain meaningful Reproduce the puzzle set
Cover, index, instructions, puzzles and solutions in one PDF Check numeric uniqueness and ambiguity when letter values are hidden Set counts, clue targets and a random seed

Generate a small book

Use Git and Python 3.12+; Python 3.13 is verified. Dependencies are local PDF/SVG tools—no account, API key or external service.

git clone https://github.com/Muneer320/LEAP.git
cd LEAP
python -m pip install -r requirements.txt
python main.py -e 2 -m 0 -a 0 -g 0 --seed 42 -n My_Sudoku_Book -d

Open My_Sudoku_Book.pdf in the current directory. Start with E1, solve it, and fill its For Next Puzzle table from the indicated solution coordinates. Use those values for a, b, c in E2.

The seed reproduces puzzle/link choices; it is not a promise of byte-identical PDF metadata. Without -d, intermediate SVGs and link tables stay in a unique puzzles/run-* directory. -d removes only that invocation's intermediates after book creation, preserving other runs. A book with the same output name can replace the prior PDF.

From Sudoku grid to linked pages

flowchart LR
    Full[Generate complete Sudoku] --> Remove[Remove clues while keeping one solution]
    Remove --> Letters[Select digits to display as letters]
    Letters --> Check[Check ambiguity without letter values]
    Check --> Link[Map letter values to previous solution coordinates]
    Link --> SVG[Render puzzle and solution SVGs]
    SVG --> PDF[Assemble printable book]
Loading

Note

Difficulty labels are presets, not human-solving ratings. Clue targets and letter counts vary by tier. The generator may keep more clues than requested to preserve uniqueness. Ambiguity without the letters establishes a dependency, not a proof that every reader must solve the preceding page to infer them.

Counts, clue targets, title and intermediate-file options
Option Meaning Default
-n, --name PDF filename LEAP
-e, --easy Easy puzzles 15
-m, --medium Medium puzzles 10
-a, --advanced Advanced puzzles 5
-g, --grandmaster Grandmaster puzzles 3
-eh, --easy-hints Easy clue target 40
-mh, --medium-hints Medium clue target 36
-ah, --advanced-hints Advanced clue target 27
-gh, --grandmaster-hints Grandmaster clue target 27
--seed Repeat the same puzzles and links Random
-ct, --cover-text Print the title on the cover Off
-d, --delete Remove this run's intermediate files Off

Set any tier count to zero to skip it. At least one puzzle is required. Hint targets must be from 24 to 81; the generator may retain more than requested. Grandmaster pages use more letters than easy pages, but the program does not provide a formal difficulty rating.

Explore and contribute

File Role
main.py Argument validation, seeded runs and book orchestration
generatePuzzle.py Sudoku generation, uniqueness checks, letter/link selection and SVG output
createBook.py PDF layout, artwork, tables and solutions
PROJECT_DESCRIPTION.md Design details and limits

Run python -m unittest discover -s tests -v for chain checks. For a focused PR, preserve uniqueness/link checks, generate a small seeded book and inspect its puzzle/table/solution pages. Report issues with the exact counts, hint targets and seed in the tracker.

LEAP started as a follow-up to BOOP, exploring Sudoku with links between pages. Created by Muneer Alam. MIT license.

About

Python-powered tool to craft Sudoku books where each puzzle relies on the solution of the previous one.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Contributors

Languages