A program to find solution of a given 24-puzzle problem.
Given a intial state of a 24-puzzle problem,
and the program finds the best solution, the one with the fewest steps,
by A* searching according to Manhattan Distance, a consistent heuristic.
This is an assignment on NTOU Artificial Intelligence 2016 Spring.
This repository as a note help me to find the code in the future! 😀
#1 |
---|
0ABCDEFGHIJKLMNOPQRSTUVWX |
#2 |
---|
F0BCDAKGHIEJLMNOPQSRTUVWX |
#3 |
---|
F0BCDAKGHIEJLMNOPQRSTUVWX |
#4 |
---|
EABCDFKGHITOLMNJ0PRSUVQWX |
QUIT to end the program!
#1 |
---|
0ABCDEFGHIJKLMNOPQRSTUVWX is already a goal state. |
#2 |
---|
No solution for F0BCDAKGHIEJLMNOPQSRTUVWX!! |
#3 |
---|
Solution for F0BCDAKGHIEJLMNOPQRSTUVWX is: move 0 to left move 0 to down move 0 to down move 0 to right move 0 to up move 0 to up move 0 to left |
#4 |
---|
Solution for EABCDFKGHITOLMNJ0PRSUVQWX is: move 0 to left move 0 to up move 0 to right move 0 to down move 0 to right move 0 to down move 0 to left move 0 to left move 0 to up move 0 to up move 0 to right move 0 to up move 0 to left move 0 to up |
This project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License and the MIT License.