Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deepu105/battleship-rs
A terminal battleship game in Rust
https://github.com/deepu105/battleship-rs
Last synced: about 2 months 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-12T14:25:26.000Z (3 months ago)
- Last Synced: 2024-09-13T02:46:10.306Z (3 months ago)
- Language: Rust
- Size: 954 KB
- Stars: 87
- Watchers: 3
- Forks: 7
- 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
```![demo](./demo.gif)
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