Skip to content

cwalcott/queens-cli

Repository files navigation

queens-cli

A keyboard-driven terminal puzzle game written in Rust. Place one queen in each colored region of an N×N board so that no two queens share a row, column, or touch each other (including diagonally). Puzzles are procedurally generated with a guaranteed unique solution.

Install

cargo install --git https://github.com/cwalcott/queens-cli

Requires Rust stable. A color-capable terminal (256-color or truecolor) is recommended.

Play

queens                        # 8×8 medium (default)
queens --size 9               # 9×9 board
queens --difficulty hard      # hard difficulty
queens -s 6 -d easy           # 6×6 easy
queens --seed 1234567         # reproduce a shared puzzle
queens --letters              # region letters in cells (colorblind aid)
queens --help                 # all options

Rules

  1. Place exactly one queen per row.
  2. Place exactly one queen per column.
  3. Place exactly one queen per colored region.
  4. No two queens may be king-adjacent (touching, including diagonally).

Controls

Key Action
Arrows / h j k l Move cursor
Space / Enter Cycle cell: Empty → Mark → Queen → Empty
x Toggle mark (clears a queen)
Left / right click Cycle cell / toggle mark
a Toggle auto-X (dims eliminated cells)
u Undo
c Clear board
n New puzzle (same size & difficulty)
d Cycle difficulty
[ / ] Decrease / increase board size
? Help overlay
q / Esc Quit

Queens currently in conflict are highlighted in red. Auto-X (on by default) dims cells that are already eliminated by your placed queens — useful for narrowing down where each queen must go.

The win screen shows the puzzle's seed; share it and the board size / difficulty, and queens --seed <N> reproduces the exact same puzzle.

Build from source

git clone https://github.com/cwalcott/queens-cli
cd queens-cli
cargo build --release
./target/release/queens
cargo test --all-features                              # run tests
cargo clippy --all-targets --all-features -- -D warnings  # lint

Design

SPEC.md documents the rules, architecture, generation algorithm, difficulty grading, and TUI design in full.

License

MIT — see LICENSE.

About

Keyboard-driven terminal Queens logic puzzle in Rust — procedurally generated, unique solutions, easy/medium/hard difficulty

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages