Skip to content

cgr28/15-puzzle-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

15 Puzzle Solver

Multiple implementations of a 15 puzzle solver and a 15 puzzle terminal game.

  1. Game
  2. Solver

Game

Installation

pip install click

Usage

python3 game.py -s [number of shuffles]

Args

  • -s - The number of times the board will be shuffled. [Default: 250] [optional] [example: -s 50]

Help

python3 game.py --help

Examples

Start a game with 250 shuffles

python3 game.py -s 250

Solver

Usage

  1. Edit the PUZZLE variable with your puzzle configuration.
  2. Call python3 solver.py [astar|idastar|bfs] [number of shuffles] to generate a solution.

Args

  • solver - The solver that will be used to solve the 15 puzzle. [Options: astar | idastar | bfs] [required] [example: astar]
  • shuffles - The number of time the board will be shuffled. [Default: 0] [optional] [example: 50]

Solvers

Generates a solution the fastest. Solution not guranteed to be optimal.

Takes longer to generate solutinons. Solutions are optimal.

Takes longer to generate solutinons. Solutions are optimal.

Examples

Solve a puzzle using astar with no shuffles.

python3 solver.py astar 0

Solve a puzzle using idastar with 10 shuffles.

python3 solver.py idastar 10

Solve a puzzle using bfs with 50 shuffles.

python3 solver.py bfs 50

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages