AZTest
← All Logic Puzzles
Loops Pure Logic · No Guessing 100 Online Levels

Masyu

Draw one closed loop through cell centres that rigorously obeys the black and white pearls.

Alternative Names: Shiroshinju Kuroshinju (白真珠・黒真珠) Pearl Puzzles Shinju no Kubikazari Evil Loop

Basic Game Premise & Rules

Masyu is an untimed, deterministic pencil-and-paper logic puzzle played on a grid. Every valid puzzle has exactly one unique solution that can be discovered through rigorous deductive reasoning alone, without trial and error or guessing.

Rules by Example

See how each rule looks when done correctly versus when violated:

Black pearl

The loop turns a corner on it, and goes straight through the next cell on both sides.

✓ Correct A corner on the pearl; both lines go straight through the next cell, and only turn after that.
✗ Wrong No corner on the pearl. A black pearl is always a corner.
✗ Wrong A second corner in the very next cell. Each line must go straight one more cell first.

White pearl

The loop goes straight through it, and turns a corner in the cell just before or just after it (or both).

✓ Correct Straight through the pearl, with a corner in the cell just before it.
✗ Wrong A corner on the pearl. A white pearl is always passed straight through.
✗ Wrong Straight through, but no corner in the cell just before or just after it.

History & Origins

Masyu was created by Japanese puzzle creator 'Masyu' and first published in *Puzzle Communication Nikoli* #84 in 1999 under the poetic title *Shinju no Kubikazari* ('Pearl Necklace'). Nikoli later abbreviated the name to **Masyu**.

Unlike Slitherlink, which draws loops along grid edges, Masyu draws loops through cell centres, guided entirely by the contrasting behaviors of white and black pearls. The rules reflect a delicate geometric balance: black pearls demand local rigidity (a corner flanked by two straight runs), while white pearls enforce directional continuity flanked by proximate turns. Masyu quickly achieved global fame and became a permanent centerpiece of the World Puzzle Championship (WPC).

Mathematical Concepts & Computational Complexity

Beyond its entertainment value, Masyu formalizes core principles of discrete mathematics, theoretical computer science, and combinatorics:

NP-Completeness via Planar 3-SAT

In 2002, Erich Friedman proved that Masyu is NP-complete. By constructing elaborate turn-gadgets, crossover wires, and logic gates exclusively out of black and white pearls, Friedman demonstrated that deciding whether a valid Masyu loop exists can encode any instance of 3-SAT in polynomial time.

Turn-Constraint Metrics on Lattice Paths

Masyu formalizes a constrained Hamiltonian cycle problem on a subset of the grid graph G = (V, E) with turn-penalty metrics. While finding a Hamiltonian cycle is NP-complete in general, Masyu adds strict curvature requirements: at white pearls, the turning angle is 0° with non-zero curvature in adjacent steps; at black pearls, the turning angle is exactly ±90°.

Boundary Collision & Degree 2 Invariants

Because black pearls require straight extensions in both directions, placing a black pearl along the board boundary immediately forces the two arms into the grid interior. Similarly, two adjacent white pearls on the same line create alternating parity turns that can be evaluated via linear algebraic constraints.

References & Further Reading

  1. Friedman, E. (2002). 'Pearl Puzzles are NP-complete'. Stetson University Technical Reports.
  2. Nikoli (1999). Puzzle Communication Nikoli #84. Tokyo: Nikoli Publishing.
  3. Hearn, R. A., & Demaine, E. D. (2009). Games, Puzzles, and Computation. CRC Press. ISBN: 978-1568813226.
  4. Kaji, H. (2000). The World of Masyu Puzzles. Tokyo: Nikoli.

Free Printable PDF Booklet

50 Levels Included · Solutions in Back

Download our beautifully formatted, high-resolution A4 puzzle booklet. Generated directly from the handcrafted levels on AZTest, it contains 50 puzzles ordered from gentle introductory boards up to master-level challenges, followed by complete solutions at the back.

Difficulty Stage Grid Size Description Puzzles
Intro 5×5 Clean pearl demonstrations: corner turns and straight lines. 3
Easy 5×5 to 6×6 Edge pearls and forced turn directions on small grids. 12
Medium 7×7 to 8×8 Dense pearl clusters and loop collision avoidance. 12
Hard 8×8 to 10×10 Multi-pearl corridors and white pearl turn propagation. 12
Expert 10×10 Master grids requiring long-range topological closure. 11
📥 Download Masyu Booklet (PDF) 721 KB

Formatted for standard A4 printing. 4 puzzles per page provides ample workspace for pencil solving. Free to distribute for personal or educational use.

Explore More Logic Puzzles

Slitherlink

Connect dots to draw a single unbroken loop guided by surrounding cell numbers.

Wolves & Sheep

Draw a Slitherlink loop that fences the gentle sheep in and keeps the fierce wolves out.

Nurikabe

Shade the sea to leave numbered white islands of exact sizes in one connected ocean.

Nonogram

Shade runs of cells according to row and column number clues to reveal a hidden picture.

Themed Nonogram

Solve color picture cross puzzles that blossom into vibrant pixel art upon completion.

Hitori

Shade the repeated numbers until every row and column has unique digits, keeping all white cells connected.

Kurodoko

Shade cells so every numbered circle sees exactly that many white cells in its row and column.

Mosaic

Shade cells guided by numbers that count how many cells around them are filled, revealing a hidden picture.

Binairo

Fill every cell with blue or white circles: never three in a row, every line half and half.

Heyawake

Shade rooms according to their clues without isolating unshaded cells or leaving long straight corridors.

Searchlights

Place light beams in white cells so that every numbered black post sees its exact clue count.

Light Up

Place light bulbs to illuminate every white cell without any two shining on each other.

Calcudoku

A Latin square where every outlined cage satisfies its arithmetic target and operator.

Skyscrapers

Place towers of heights 1 to N so that each outside clue sees the exact count of buildings.

Sum Skyscrapers

Skyscrapers where each outside clue is the sum of the heights of all visible buildings.

Suguru

The elegant polyomino number puzzle where no two identical digits can touch, even diagonally.

Futoshiki

A Latin square puzzle with inequality signs pointing between neighboring numbers.

Fillomino

Divide the grid into polyomino blocks where each cell's number equals the area of its block.

Galaxies

Partition the grid into rotational 180° symmetric galaxies, each centered on a single dot.

Shikaku

Cut the whole grid into rectangles and squares, each containing exactly one number: its area.

L-Pieces

Draw borders to partition all white cells into perfect four-cell L-shapes.

Numberlink

Connect pairs of matching numbers with continuous non-crossing paths covering the grid.

Bridges

Connect the island network with straight horizontal and vertical bridges into one united world.

Slant

Draw a diagonal slash in every cell matching the corner numbers, without ever closing a loop.

Tents

Pitch a tent beside every tree with no two tents touching, matching row and column counts.

Marupeke

Place circles and crosses in every cell without creating three in a row in any direction.

Ready to play Masyu?

Test your deduction skills online with 100 free interactive levels, automatic conflict detection, progressive hints, and continuous browser save state.

Start Playing Level 1 →