65c7c2b3c2a26c80dcb8b4694e2395ef49ee51c3
Solitaire Chess Puzzle Generator
Goal: Generate 'hard' puzzles.
Install
- Install Rust from here.
- Run
cargo install --git https://github.com/cool-mist/sol_chessto install the tool. - Run
sol_chess --helpto see the options.
Usage
- Generate a puzzle
$ sol_chess -g -n 6
Generated a puzzle with 6 pieces after 330 ms
PP..
..PB
.K..
.N..
- Solve a puzzle
$ sol_chess -- --solve PP....PB.K...N..
PP..
..PB
.K..
.N..
Found 1 solutions
1. Nb1 -> c3
2. Nc3 -> a4
3. Na4 -> b2
4. Nb2 -> d3
5. Nd3 -> b4
- Generate and solve a puzzle
$ sol_chess -g -n 6 --print
Generated a puzzle with 6 pieces after 933 ms
.P.N
B.R.
.K..
..N.
Found 1 solutions
1. Ba3 -> b4
2. Bb4 -> c3
3. Bc3 -> d4
4. Bd4 -> b2
5. Bb2 -> c1
Heuristics of current algorithm
- About 6-7 pieces on the board.
- Select pieces to place based on its weight. 3. Eg: Queen is too powerful, so it has lower weightage. 4. Eg: Knights are confusing. More knights.
- Discard puzzles with more than one solution.
Example puzzles generated
N...
P.B.
.R..
..KP
R...
..P.
..B.
.KNN
.PN.
P...
K..P
.R..
..PK
...R
P..P
B..N
Description
Solitaire chess solver and puzzle generator implemented in rust
Readme
AGPL-3.0
2.3 MiB
0 Stars
3 Watchers
0 Forks
Languages
Rust
96.5%
Shell
2.9%
HTML
0.6%