| Crates.io | simple_battleship |
| lib.rs | simple_battleship |
| version | 0.1.1 |
| created_at | 2024-12-26 18:51:01.733721+00 |
| updated_at | 2025-10-25 16:57:10.090419+00 |
| description | A simple Battleship game implemented in Rust. |
| homepage | |
| repository | https://github.com/mzums/battleship |
| max_upload_size | |
| id | 1495888 |
| size | 64,284 |
Welcome to the Battleship Game implemented in Rust! Engage in a thrilling game of strategy and skill against an AI opponent on the high seas. Sink your opponent's fleet before they sink yours!

: Empty cellcargo install simple_battleshipsimple_battleship
or simple_battleship --tuigit clone https://github.com/mzums/battleship
cd battleship
cargo run
cargo run -- --tui
Ship Placement: Ships of varying lengths (5, 4, 3, 3, 2) are randomly placed on the board without overlap or adjacency.
AI Strategy: The AI utilizes a heatmap to determine optimal moves and targets ships intelligently by continuing hits on partially discovered ships.
Player Input:
Input coordinates in the format [Letter][Digit] (e.g., A1). Invalid inputs prompt re-entry.
rand: For generating random numbers.regex: For validating player input.colored: For colorful terminal output.Contributions are welcome! Feel free to submit issues or pull requests to improve the game.
This project is licensed under the MIT License. See the LICENSE file for details.