JanSkn / 8-puzzle-solver

Different AI search algorithms to solve the 8-puzzle.
MIT License
1 stars 0 forks source link


image

8-puzzle Solver

Different algorithms to solve the 8-puzzle.
Explore the docs »

Report Bug · Request Feature


About The Project

image



The 8-puzzle consists of a 3x3 grid containing 8 tiles numbered from 1 to 8 and one blank space. The objective is to move the tiles around the grid by sliding them into the blank space in order to achieve a specific goal state, typically where the tiles are arranged in numerical order.

The puzzle begins with a random configuration of the tiles, and the player can only move tiles horizontally or vertically into the blank space.

In src, you can find different solutions solving the puzzle: Greedy and A* algorithm.

(back to top)

Installation

Follow these steps to run the project.

  1. Clone the repo
    git clone https://github.com/janskn/8-puzzle-solver.git
  2. Install Python
    sudo apt-get install python3
  3. Install NumPy
    pip install numpy
  4. Install Tkinter
    pip install tkinter

(back to top)

Built With

The source code was built with Python, mainly using NumPy and Tkinter.

(back to top)

Usage

Simply run the files greedy.py or a_star.py in src and click the button to see the solution.

(back to top)

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)