A fast, lightweight, and minimalist terminal-based Minesweeper game written entirely in Rust. Play the classic logic puzzle game directly from your command line without any graphical distractions.
- Terminal Native: Runs entirely in your command line/terminal emulator.
- Blazing Fast & Safe: Built with Rust, ensuring snappy performance, memory safety, and minimal resource footprint.
- Customizable Grids: Play on standard difficulties (Beginner, Intermediate, Expert) or specify custom grid sizes and mine counts.
- Keyboard Navigation: Navigate and interact with the grid using intuitive keyboard controls.
- Cross-Platform: Works seamlessly on Linux, macOS, and Windows.
To build and run this project from source, you will need to have Rust and Cargo installed on your system.
If you don't have Rust installed, you can easily get it via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shClone the repository and compile the project using Cargo:
git clone https://github.com/ibrohim-b/minesweeper-cli.git
cd minesweeper-cli
cargo build --releaseTo install the executable globally so you can run it from anywhere, use:
cargo install --path .After running cargo install --path ., the minesweeper command is placed in ~/.cargo/bin/. Make sure that directory is on your PATH:
export PATH="$HOME/.cargo/bin:$PATH"Add that line to your shell config (~/.bashrc, ~/.zshrc, etc.) to make it permanent. You can verify the installation with:
which minesweeper
minesweeper --versionStart the game by simply running the executable:
minesweeper(If you haven't installed it globally, you can just use cargo run --release from the project directory).
- Navigation: Use
Arrow Keys(orw/a/s/d) to move your cursor across the grid. - Reveal Cell: Press
SpaceorEnterto dig/reveal a cell. - Flag Mine: Press
Fto plant or remove a flag (🚩) on suspected mines. - Quit: Press
Qto exit the game.
Contributions, issues, and feature requests are always welcome! Feel free to check the issues page if you want to contribute.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Developed with ❤️ by ibrohim-b