Skip to content

Puzzle solver is a Java app which implements A* algorithm for numeric puzzles.

Notifications You must be signed in to change notification settings

Bombo01/Puzzle-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puzzle solver

Puzzle solver is a Java app which implements A* algorithm for numeric puzzles.
Using this app, you can solve 8 puzzle, 15 puzzle...

Usage

First, you need to create a new text file as in the examples in tables.
Then, you can use this app using these commands:

javac Solver.java
java Solver fileName.txt

Result

This app will print something like:

4
0 1 3 4 2 5 7 8 6 
1 0 3 4 2 5 7 8 6 
1 2 3 4 0 5 7 8 6 
1 2 3 4 5 0 7 8 6 
1 2 3 4 5 6 7 8 0 

where 4 is the Manhattan distance of the given board and the other lines are the steps to do in order to find the solution:

0 1 3       1 0 3       1 2 3       1 2 3       1 2 3
4 2 5       4 2 5       4 0 5       4 5 0       4 5 6
7 8 6       7 8 6       7 8 6       7 8 6       7 8 0 

Releases

No releases published

Packages

No packages published

Languages