GenerateRandomSearch

Pipe Network Puzzle Generator

Every square holds a piece of pipe — a dead end, a straight, a bend, a T or a cross — and turning them is the only move. The puzzle is done when every pipe end meets another, nothing points off the edge, and the whole thing is joined into a single network with no loop anywhere in it. That last condition is what makes it a puzzle rather than a fiddle: a loop would give some square two ways in, and the network here always has exactly one.

What this generator does

Grows a network that reaches every square by exactly one route, reads the piece that sits in each square off it, then turns each piece at random to set the puzzle.

How to use this tool

  1. Choose a grid size and print or copy the sheet.
  2. Turn each piece a quarter at a time until its ends meet the pieces beside it.
  3. Start at the edges: a piece there cannot point outwards, which often settles it at once.
  4. Watch for loops — a ring of pipe is wrong even when every end is matched.
  5. Show the answer to check the finished network.

Understanding the controls

Grid
Four to twelve squares a side. Twelve is a judgement about what is comfortable to turn piece by piece on paper, not a limit of the builder — twenty a side still builds in under a millisecond.
Seed (optional)
Type anything to rebuild the same puzzle later, which is how you reprint a page you have lost. A seed makes the grid repeatable and is not a cryptographic key.

Common use cases

  • A puzzle for anyone who likes rearranging rather than deducing
  • A printable page for a puzzle club or a wet afternoon
  • A gentle introduction to networks and connectivity, for a classroom
  • A large grid as a long, calm puzzle, or a small one as a two-minute warm-up
  • Reprinting the identical grid later from its seed

How this generator works

The answer is grown first, as a network that reaches every square by exactly one route, and each square's piece is then simply read off it. Turning those pieces at random gives the puzzle. Proving there is only one answer is the interesting half, and it turns on the no-loop rule: the solver settles squares in reading order and refuses outright any join that would connect two squares already connected, so a loop is never drawn rather than drawn and undone. That leaves a collection of separate networks, and one further count — the joins must number exactly one fewer than the squares — makes it a single one. Both halves are needed, and the first version of this had only the first: it accepted four dead ends in a two-by-two grid as a solved puzzle, when they are two separate pipes. Measured across 280 grown networks from six to twenty a side, 276 were already pinned down by their own pieces, so the builder rarely has to try again.

Randomness and fairness

The network and the way each piece is turned come from your browser's cryptographic random source. A seed replaces it with a repeatable one so the same grid comes back — a seed is for reproducibility, not cryptographic strength, and two people with the same one get the same puzzle.

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 judgement about paper rather than a measured limit.
  • There is no difficulty setting: a bigger grid takes longer, but the reasoning is the same at every size.
  • Every piece is given, so there is nothing to hide and no way to make a grid harder except by making it larger.
  • A cross is already correct however it sits, so a grid with many of them gives itself away in places.

Privacy and your data

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