An open API service indexing awesome lists of open source software.

https://github.com/simre1/sliding-puzzle-sat


https://github.com/simre1/sliding-puzzle-sat

Last synced: 10 months ago
JSON representation

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:
```



```