Stateful Next.js Block Puzzle Solver

Play turn-by-turn with a board that persists, scores, and re-solves from its latest state.

Set the opening board, solve a 3-piece turn, store the updated grid, then continue from that exact board on the next turn. Game state and history persist in local storage.

Turn 1History 0

Persistent Board

Initialize Starting Grid

Session Ready

Playback

Step-by-Step Visualization

Solve a turn to inspect placements and cleared lines.

Future Shapes

User-Driven Shape Library

0 saved

Draw possible future pieces here. Added shapes are normalized, deduplicated, and passed into the future evaluator on every solve.

No future shapes added. Default shapes will be used.

Piece 1

Shape Editor

Piece 2

Shape Editor

Piece 3

Shape Editor

Session State

Persistent Game Engine

{
  "current_grid": [
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ]
  ],
  "turn_number": 1,
  "future_shapes_count": 0,
  "history": []
}

Turn Output

Latest Turn JSON

{
  "sequence": [],
  "final_grid": [
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ]
  ],
  "turn_score": 0
}

History

Score Timeline

No turns solved yet.

Saved Shapes

Load Into Pieces

0 available
Save future shapes first, then load them straight into Piece 1, 2, or 3.