https://github.com/simre1/sliding-puzzle-sat
https://github.com/simre1/sliding-puzzle-sat
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simre1/sliding-puzzle-sat
- Owner: Simre1
- Created: 2022-11-24T13:00:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-11T13:23:15.000Z (over 3 years ago)
- Last Synced: 2024-12-29T05:22:21.829Z (over 1 year ago)
- Language: Haskell
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# sliding-puzzle-sat
Haskell program which calculates the sat formula for a 3x3 sliding puzzle game which can be solved with limboole.
## The Game
You start with a 3x3 field of numbers from 0 to 8 where each number occurs once:
```
4 3 5
9 2 3
1 0 7
```
The game rules state that you can only swap numbers with the `0` vertically and horizontically. The game goal is to rearrange the numbers in an ascending manner by swapping with the `0`:
```
1 2 3
4 5 6
7 8 0
```
## How to run
You need the Haskell build tool `cabal` and the Haskell compiler `ghc` (use ghcup to install them). Then you can run the program with:
```
cabal run sat-game ...
```
`` tells the sat solver how many moves to try to find a solution.
`` tells the sat solver where the numbers are in the initial state.
The field arguments are arranged in this manner:
```
```