https://github.com/deepu105/battleship-rs
A terminal battleship game in Rust
https://github.com/deepu105/battleship-rs
Last synced: 13 days ago
JSON representation
A terminal battleship game in Rust
- Host: GitHub
- URL: https://github.com/deepu105/battleship-rs
- Owner: deepu105
- License: mit
- Created: 2021-06-27T21:34:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T16:31:45.000Z (6 months ago)
- Last Synced: 2025-03-31T15:19:06.427Z (20 days ago)
- Language: Rust
- Size: 954 KB
- Stars: 90
- Watchers: 2
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ratatui - Battleship.rs - Terminal-based Battleship game. (đģ Apps / đšī¸ Games and Entertainment)
README
# Battleship.rs
A terminal battleship game in Rust.
Run with docker:
```
$ docker run --rm -it deepu105/battleship:main
```
This is slightly different than the traditional battleship game.
There are 4 types of ships that will be placed randomly at different rotations in each players board
- **Fighter** [X shaped]
- **Carrier** [H shaped]
- **Destroyer** [V shaped]
- **Scout** [I shaped]There are 3 rules with which the game can be played. This can be passed as argument `-r ` to the CLI
- **Default**: Only one salvo/shot per turn
- **Fury**: You can select salvo/shot up to the number of ships alive in your board
- **Charge**: You start with one salvo/shot per turn and as you sunk opponent ships you get one additional shot per ship sunkenThe default difficulty level is hard. You can set to easy difficulty by passing `-d ` to the CLI
pass `-h` for help
You can also clone the repo and run `cargo run`
**Note**: Works only in Linux/Mac for Windows use docker command above.
**TODO**: Make this work also in web assembly
UI inspired from https://github.com/cpcloud/minesweep-rs