GenerateRandomSearch

Star Battle Puzzle Generator

Place one star in every row, every column and every irregular region, with no two stars touching — not even at a corner. The rows-and-columns part is a familiar permutation constraint; the regions and the no-touching rule are what turn it into a puzzle, because they interact in ways that are hard to see and easy to get almost right. The region shapes here are grown around a hidden solution and then tested until only that one arrangement works.

What this generator does

Places a legal set of stars first — one per row and column, none adjacent — then grows an irregular region around each. The finished grid is solved from the region shapes alone and published only when exactly one arrangement of stars satisfies every rule, with each region also confirmed to be a single connected piece.

How to use this tool

  1. Choose a grid size and generate a puzzle.
  2. Place one star in each row, column and coloured region.
  3. Make sure no two stars touch, including diagonally — that rule does most of the eliminating.
  4. Reveal the answer to check, or seed the puzzle to set it again later.

Understanding the controls

Grid size
Between 5 and 8. The grid always has as many regions as it has rows, so a 6x6 puzzle has six regions and six stars.
Show the answer
Marks the star in each region. Hidden by default so the grid can be printed or shared unsolved.
Seed
Any word reproduces exactly the same regions and the same star placement.

Common use cases

  • Printable Star Battle puzzles for a puzzle page or a classroom starter
  • Practising constraint reasoning across three overlapping rules at once
  • Showing how a non-adjacency rule interacts with a permutation rule
  • Test instances for a Star Battle solver
  • Setting the same puzzle for several people from one seed

How this generator works

Regions grow outward from each star by repeatedly attaching an unclaimed cell to a neighbouring region, which keeps every region connected by construction — and the checker confirms it anyway, by flood-filling each region and comparing sizes. Solving searches row by row, rejecting any column or region already used and any star adjacent to the one above, and counts arrangements rather than stopping at the first.

Randomness and fairness

The star placement and the region shapes are random, and the puzzle follows from them. A seed reproduces the same grid exactly and is therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.

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

Limitations and good to know

  • One star per row, which is the 1-star variant; 2-star Star Battle is a harder and separate puzzle.
  • Grids run from 5x5 to 8x8.
  • Region shapes are grown randomly, so they are irregular but not designed for elegance.
  • Difficulty is not graded, so a solvable puzzle may still take a long while.
  • The page retains nothing; the seed is the only way back to this puzzle.

Privacy and your data

The grid, the regions and every candidate arrangement are computed on your device only. Nothing about the puzzle or your seed is sent anywhere.