From 0bd216893e9418f87422e53bab768d1fe99ff5e2 Mon Sep 17 00:00:00 2001 From: cool-mist Date: Thu, 22 Jan 2026 18:27:32 +0530 Subject: [PATCH] update readme --- README.md | 47 +++++++++++++++++++++-------------------------- cli/src/main.rs | 11 ++++++----- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index cb8eba0..cd6f28e 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,6 @@ Goal: Generate 'hard' puzzles. - Run `sol_chess` to start a windowed GUI game. - 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 - Generate a puzzle @@ -26,46 +22,45 @@ Goal: Generate 'hard' puzzles. ```bash $ sol_cli -g -n 6 Generating a puzzle with 6 pieces with a maximum of 5 solutions - Total attempts: 7 - Total pieces placed: 71 - Success pieces placed: 42 - Total time (ms): 69 + Total attempts: 16 + Total pieces placed: 131 + Success pieces placed: 96 - ♘ . . . + ♙ ♗ . . - ♙ . ♖ . + . . . . - ♔ . ♘ ♙ + ♗ ♖ . . - . . . . + ♙ . . ♙ - id: 202859896274992 + id: wmgYAAAG ``` - Solve a puzzle by ID, or by board string ```bash -$ sol_cli --solve 202859896274992 -$ sol_cli --solve-board N...P.R.K.NP.... +$ sol_cli --solve wmgYAAAG +$ sol_cli --solve-board pb......br..p..p - ♘ . . . + ♙ ♗ . . - ♙ . ♖ . + . . . . - ♔ . ♘ ♙ + ♗ ♖ . . - . . . . + ♙ . . ♙ - id: 202859896274992 + id: wmgYAAAG -Found 3 solutions -1. RxNc2 -2. RxPd2 -3. RxKa2 -4. RxPa3 -5. RxNa4 +1. RxBb4 +2. RxPa4 +3. RxBa2 +4. RxPa1 +5. RxPd1 +There are atleast 1 solutions to this puzzle ``` diff --git a/cli/src/main.rs b/cli/src/main.rs index 7ddbecc..bb63a7a 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -13,8 +13,9 @@ fn main() { return; }; + puzzle.board.pretty_print(); if args.print { - print_solutions(puzzle); + print_solutions(&puzzle); } return; @@ -34,12 +35,12 @@ fn main() { }; let puzzle = board.solve(); - print_solutions(puzzle); + puzzle.board.pretty_print(); + print_solutions(&puzzle); } -fn print_solutions(puzzle: Puzzle) { - puzzle.board.pretty_print(); - let solutions = puzzle.solutions; +fn print_solutions(puzzle: &Puzzle) { + let solutions = &puzzle.solutions; if solutions.len() == 0 { println!("No solutions found"); return;