An open API service indexing awesome lists of open source software.

https://github.com/maxleiter/slidingnumberpuzzle

Solve N x N sliding block number puzzles with A*
https://github.com/maxleiter/slidingnumberpuzzle

ai astar-algorithm

Last synced: 3 months ago
JSON representation

Solve N x N sliding block number puzzles with A*

Awesome Lists containing this project

README

        

# SlidingNumberPuzzle
A basic A* solver for the popular sliding puzzle game.
For solving a game like this
![this](https://sr.ht/KVOp.jpg)

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`