An 8 puzzle solver Python application utilising A-star algorithm. Goal state can be reached by expanding a given state to its successor or children states, as the application find a match for each generated child. Once the goal is found, the application trace and display the path leading to the initial state. Solution path is shown by animating the tiles as it moves one tile at a time towards the goal state.
Ready to accept input for an initial state
Ready to accept input for a goal state
All inputs are all set and ready to commence searching via 'Find Solution' button
Output result
- Python 2.7
- Pygame
- SimpleGUICS2Pygame
Change image (logo) file path to your own path
image_logo = simplegui.load_image('file:///C:/8-puzzle-solver/logo.png')
python eightPuzzle.py
- Enter the initial and goal states by clicking one tile a time in the keypad found on the right side of the canvas. The direction of each tile input goes from left to right for each row (top to bottom).
- Once all inputs are in placed, click 'Find Solution' button.
- Click 'Show Solution' button for the tiles animation of the solution path.
No pull request at the moment. Thanks.
This package is Copyright (c) Ryan Gilera 2014 and is licensed under the MIT license. See license for more information.