Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dev-michael-schmidt/ai-sliding-puzzle
Solve an NxN sliding puzzle problem using the A* algorithm
https://github.com/dev-michael-schmidt/ai-sliding-puzzle
a-star artifical-intelligense sliding-puzzle-game
Last synced: 1 day ago
JSON representation
Solve an NxN sliding puzzle problem using the A* algorithm
- Host: GitHub
- URL: https://github.com/dev-michael-schmidt/ai-sliding-puzzle
- Owner: dev-michael-schmidt
- License: mit
- Created: 2017-10-08T16:26:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-15T03:45:48.000Z (almost 6 years ago)
- Last Synced: 2024-03-20T04:44:59.456Z (8 months ago)
- Topics: a-star, artifical-intelligense, sliding-puzzle-game
- Language: C++
- Size: 46.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AI-sliding-puzzle
Solve an NxN sliding puzzle problem using the A* algorithm### How to Build:
clone the project and type `make`### Usage:
Generate a board: `./random_board < `
Solve a board: `./a_star < `
or simply chain the operations together:
`./random_board 1 100 < puzzle.txt | ./a-star 2`#### where:
``
A seed value for the random number generator.``
Specifies show many shuffles to make on the board.``
A file that specifies what a solution should look like. Use 0 for blank.
e.x.:
0 1 2
3 4 5
6 7 8``
Mode 0: Use no heuristic (Same as greedy search).
Mode 1: Use number of tiles displaced.
Mode 2: Use Sum of manhattan distances among tiles.
Mode 3: Use Sum of euclidean distances among tiles.
``
Specify via STDIN the puzzle. As noted earlier, use `./random_board` to do this.
`./random_board 1 100 < completed.txt > shuffled_puzzle.txt` then `./a-star 2 < shuffled_puzzle.txt`
or simply...
`./random_board 1 100 < puzzle.txt | ./a_star 2`