/8-puzzle-solver

An 8-puzzle solver using A-star with SimpleGUICS2Pygame

Primary LanguagePythonMIT LicenseMIT

8 Puzzle Solver

Description

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.

Screenshots

Ready to accept input for an initial state ScreenShot

Ready to accept input for a goal state ScreenShot

All inputs are all set and ready to commence searching via 'Find Solution' button ScreenShot

Output result ScreenShot

Requirements

Configuration

Change image (logo) file path to your own path

image_logo = simplegui.load_image('file:///C:/8-puzzle-solver/logo.png')

Usage

python eightPuzzle.py

Instructions

  1. 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).
  2. Once all inputs are in placed, click 'Find Solution' button.
  3. Click 'Show Solution' button for the tiles animation of the solution path.

Contribution Notice

No pull request at the moment. Thanks.

License and Copyright

This package is Copyright (c) Ryan Gilera 2014 and is licensed under the MIT license. See license for more information.