N Puzzle Solver

Description

The N-puzzle, also known as the sliding puzzle, is a classic puzzle game that involves a square grid with numbered tiles. The goal is to rearrange the tiles from a given scrambled state to a specific target state by sliding them into the empty space one move at a time. The empty space acts as a buffer, allowing adjacent tiles to be moved into it.

Rules

  • Only one tile can be moved at a time, and it can only be moved into the empty space.
  • Tiles can be moved vertically or horizontally but not diagonally.

Play

Solve

Generate a random puzzle and try solving it!

7
0
5
3
6
1
4
2
8