Skip to content

A program to find solution of a given 24-puzzle problem for exercise by A* searching.

License

Notifications You must be signed in to change notification settings

imprld01/24-Puzzle-Solving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

24-Puzzle-Solving

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! 😀

Testing Input

#1
0ABCDEFGHIJKLMNOPQRSTUVWX
#2
F0BCDAKGHIEJLMNOPQSRTUVWX
#3
F0BCDAKGHIEJLMNOPQRSTUVWX
#4
EABCDFKGHITOLMNJ0PRSUVQWX

QUIT to end the program!

Testing Output

#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

License

Creative Commons License
This project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License and the MIT License.

About

A program to find solution of a given 24-puzzle problem for exercise by A* searching.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages