update readme

This commit is contained in:
cool-mist
2026-01-22 18:27:32 +05:30
parent 0c88bfa24b
commit 0bd216893e
2 changed files with 27 additions and 31 deletions
+23 -28
View File
@@ -15,10 +15,6 @@ Goal: Generate 'hard' puzzles.
- Run `sol_chess` to start a windowed GUI game. - Run `sol_chess` to start a windowed GUI game.
- Run `sol_cli` to start the CLI tool. - Run `sol_cli` to start the CLI tool.
## Demo site
- Play a demo of the game [here](https://games.neophyte.me/sol_chess/)
## CLI Usage ## CLI Usage
- Generate a puzzle - Generate a puzzle
@@ -26,46 +22,45 @@ Goal: Generate 'hard' puzzles.
```bash ```bash
$ sol_cli -g -n 6 $ sol_cli -g -n 6
Generating a puzzle with 6 pieces with a maximum of 5 solutions Generating a puzzle with 6 pieces with a maximum of 5 solutions
Total attempts: 7 Total attempts: 16
Total pieces placed: 71 Total pieces placed: 131
Success pieces placed: 42 Success pieces placed: 96
Total time (ms): 69
. . . ♙ ♗ . .
♙ . ♖ .
♔ . ♘ ♙
. . . . . . . .
♗ ♖ . .
id: 202859896274992 ♙ . . ♙
id: wmgYAAAG
``` ```
- Solve a puzzle by ID, or by board string - Solve a puzzle by ID, or by board string
```bash ```bash
$ sol_cli --solve 202859896274992 $ sol_cli --solve wmgYAAAG
$ sol_cli --solve-board N...P.R.K.NP.... $ sol_cli --solve-board pb......br..p..p
. . . ♙ ♗ . .
♙ . ♖ .
♔ . ♘ ♙
. . . . . . . .
♗ ♖ . .
id: 202859896274992 ♙ . . ♙
Found 3 solutions
1. RxNc2 id: wmgYAAAG
2. RxPd2
3. RxKa2 1. RxBb4
4. RxPa3 2. RxPa4
5. RxNa4 3. RxBa2
4. RxPa1
5. RxPd1
There are atleast 1 solutions to this puzzle
``` ```
+6 -5
View File
@@ -13,8 +13,9 @@ fn main() {
return; return;
}; };
puzzle.board.pretty_print();
if args.print { if args.print {
print_solutions(puzzle); print_solutions(&puzzle);
} }
return; return;
@@ -34,12 +35,12 @@ fn main() {
}; };
let puzzle = board.solve(); let puzzle = board.solve();
print_solutions(puzzle); puzzle.board.pretty_print();
print_solutions(&puzzle);
} }
fn print_solutions(puzzle: Puzzle) { fn print_solutions(puzzle: &Puzzle) {
puzzle.board.pretty_print(); let solutions = &puzzle.solutions;
let solutions = puzzle.solutions;
if solutions.len() == 0 { if solutions.len() == 0 {
println!("No solutions found"); println!("No solutions found");
return; return;