GenerateRandomSearch

Slant Puzzle Generator

Slant, published in Japan as Gokigen Naname, asks for one diagonal in every square of the grid. A number on a corner says how many diagonal ends meet there, and the finished drawing may never close a loop. That second rule is what turns it from arithmetic into a puzzle, and every grid here is checked to have one answer and no other.

What this generator does

Draws a loop-free set of diagonals, numbers every corner with the ends meeting there, then takes numbers away one at a time — keeping a removal only while a single answer survives.

How to use this tool

  1. Choose a grid size and how many numbers you would like printed.
  2. Print or copy the grid; the numbers sit on the corners, not in the squares.
  3. Draw one diagonal in each square, matching every number as you go.
  4. Watch for loops — a diagonal that would close a circuit is wrong even when the numbers allow it.
  5. Show the answer to check your drawing.

Understanding the controls

Grid
Five to twelve squares a side. Twelve is the ceiling: it takes about a second to build where a fourteen takes nearly three.
Numbers
How many corners keep a number. Generous leaves more than half of them and builds almost instantly; spare removes every number it can, which takes longer to prove and gives a harder puzzle.
Seed (optional)
Type anything to rebuild the same puzzle later, which is how you reprint a page you have lost. Deterministic, not cryptographic.

Common use cases

  • A puzzle that is drawn rather than shaded or numbered in
  • A printable page for a puzzle club or a newsletter
  • An introduction to reasoning about connection, for anyone who likes mazes
  • A change from the usual grid puzzles for a regular solver
  • Reprinting the identical grid later from its seed

How this generator works

The no-loop rule is the heart of it, and it is treated as structure rather than as a filter. The diagonals are edges joining the corner points, so forbidding loops makes the finished drawing a forest — the same property a maze has, approached from the other side. A diagonal that would join two corners already connected to one another is therefore never drawn at all, rather than drawn and later regretted, which the search tracks as it goes and undoes as it backtracks. Corners are meanwhile bounded from both directions: the ends already at a corner may not exceed its number, and those plus the squares still undecided around it must be able to reach it. Numbers are removed one at a time and a removal is kept only while the puzzle still has a single answer.

Randomness and fairness

The diagonals, and the order the numbers are taken away in, come from your browser's cryptographic random source unless you give a seed — a seeded puzzle is deterministic, not cryptographic.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • The grid stops at twelve squares a side, which is a measured limit rather than a preference.
  • Difficulty is not graded. Avoiding a closed loop can be the easy part or the whole puzzle depending on how the vertex counts land, and that is not measured.
  • The spare setting takes noticeably longer to build, because every number it removes has to be proved unnecessary.
  • A corner with no number is unconstrained; only the printed ones are promises.

Privacy and your data

The grid is drawn, numbered and checked entirely in your browser. Nothing you type as a seed, and no puzzle made from it, leaves the device.