🎨

Nonogram

gameType: "nonogram"

Nonogram (also known as Picross) logic puzzles where the player fills in cells based on row and column clues. Each clue indicates consecutive filled cell runs. GameplayGen creates binary grids with various patterns (random, symmetric, border, cross), computes the corresponding row/column clues, and validates unique solutions. Difficulty scales via grid size and fill density.

Interactive Example

🎨 Nonogram

Picross-style logic puzzle — fill cells to reveal the pattern

difficulty: 0.38Symmetric
3
4
8
9
9
9
9
8
4
3
22
8
10
10
10
8
6
4
2
0
Pattern: Symmetric

Grid Size

10×10

Filled Cells

62

Pattern

Symmetric

Difficulty

0.38

Try it

await pf.generate({
  gameType: "nonogram",
  params: { width: 10, height: 10, pattern: "symmetric" },
  count: 5,
  difficulty: { target: 0.40 }
})

API Parameters

ParamTypeRequiredDefaultDescription
widthnumberYes5Grid width. Range 5–15.
heightnumberYes5Grid height. Range 5–15.
fillDensitynumberNoautoProportion of filled cells (0.3–0.7). If not set, automatically calculated as 0.3 + difficulty × 0.3. Higher density creates more complex clues.
pattern"random" | "symmetric" | "border" | "cross"No"symmetric"Pattern type for the solution grid. "symmetric" creates horizontally mirrored patterns (most aesthetically pleasing). "border" fills edges. "cross" creates a + pattern. "random" is pure random fill.

Pattern Types

symmetric

Horizontally symmetric — left half is mirrored to the right. Produces aesthetically pleasing pixel art-like patterns. Default and recommended.

random

Pure random fill based on density. Most varied output but least visually coherent.

border

Fills all border cells (outer ring) plus random interior at 50% density. Creates frame-like patterns.

cross

Fills center row and column, with higher density near the center. Creates "+" shaped patterns.

Content Output

ParamTypeRequiredDefaultDescription
widthnumberGrid width.
heightnumberGrid height.
solutionboolean[][]The solution grid. true = filled, false = empty.
rowCluesnumber[][]Row clues. Each row is an array of numbers indicating consecutive filled cell runs. E.g., [2, 3] means a run of 2, gap, run of 3. [0] means no filled cells.
colCluesnumber[][]Column clues. Same format as row clues.
filledCountnumberTotal number of filled cells in the solution.
patternstringPattern type that was used for generation.

Example Request

bash
curl -X POST https://api.gameplaygen.com/generate \
  -H "Authorization: Bearer gg_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "gameType": "nonogram",
    "params": {
      "width": 10,
      "height": 10,
      "pattern": "symmetric"
    },
    "count": 5,
    "difficulty": { "target": 0.5 }
  }'

Example Response

json
{
  "content": [
    {
      "id": "gg_nno3r8k",
      "gameType": "nonogram",
      "content": {
        "width": 10,
        "height": 10,
        "solution": [
          [false, true, true, false, true, true, false, true, true, false],
          [true, false, true, true, false, false, true, true, false, true],
          [false, true, false, true, true, true, true, false, true, false],
          [true, true, false, false, true, true, false, false, true, true],
          [false, false, true, true, false, false, true, true, false, false],
          [false, false, true, true, false, false, true, true, false, false],
          [true, true, false, false, true, true, false, false, true, true],
          [false, true, false, true, true, true, true, false, true, false],
          [true, false, true, true, false, false, true, true, false, true],
          [false, true, true, false, true, true, false, true, true, false]
        ],
        "rowClues": [
          [2, 2, 2], [1, 2, 2, 1], [1, 4, 1], [2, 2, 2],
          [2, 2], [2, 2], [2, 2, 2], [1, 4, 1],
          [1, 2, 2, 1], [2, 2, 2]
        ],
        "colClues": [
          [1, 2, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1],
          [1, 2, 1, 1], [1, 2, 1, 1], [1, 1, 1, 1],
          [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 2, 1]
        ],
        "filledCount": 48,
        "pattern": "symmetric"
      },
      "metrics": {
        "verified": true,
        "difficulty": 0.52,
        "balance": 0.90,
        "novelty": 1.0,
        "quality": 0.85,
        "notes": ["Symmetric pattern, 48/100 cells filled, unique solution"]
      }
    }
  ],
  "requested": 5,
  "delivered": 5,
  "stats": {
    "totalCandidates": 5,
    "totalValidated": 5,
    "totalRejected": 0,
    "totalTime": 320,
    "avgDifficulty": 0.51,
    "difficultyRange": [0.44, 0.58]
  }
}

Tips for Game Integration

  • Start with 5×5: For new players, 5×5 nonograms are the perfect introduction. Scale up to 10×10 and 15×15 for experienced players.
  • Use symmetric patterns: Symmetric patterns look like pixel art when completed, giving players a satisfying reveal moment.
  • Clue rendering: Display rowClues to the left of each row and colClues above each column. Highlight completed clues for UX.
  • X-marking: Let players mark cells as "definitely empty" (X marks). This is a core nonogram mechanic. The solution grid tells you which cells should be empty.
  • Unique solutions: Every nonogram from GameplayGen has a unique solution — there's only one way to fill the grid that satisfies all clues. This is critical for fair gameplay.