Solve N x N sliding block number puzzles with A*
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
AStar.java
AStarState.java
Board.java
README.md
SlidingPuzzle.java

README.md

SlidingNumberPuzzle

A basic A* solver for the popular sliding puzzle game. For solving a game like this this

Compile: javac *.java

Usage: java SlidingPuzzle --numbers 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0

Puzzles can be any N x N matrix. No steps are made to check if a puzzle is solvable, so you probably should make sure it's solvable before inputting it.

Add --verbose to print every visited state (even when not part of the solution).

This was made for an Artificial Intelligence independent study for two seniors in highschool. Don't judge too much.

Example:

java SlidingPuzzle --numbers 5,0,2,8,6,4,7,3,1