Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork6
Battleship game implemented in Rust
License
orhun/battleship-rs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Battleship game implemented in Rust.
Fully playable between 2 players on the terminal.
To play on the public instance:
$ nc battleship.orhun.dev 1234Minimum supported Rust version:1.38.0
$ cargo build --release$ ./target/release/battleshipThis will start the server on port1234, then players can connect to it with any tool that supports TCP sockets. For example, usingnetcat:
$ nc 127.0.0.1 1234Dockerfile is available in the repository.
$ docker build -t battleship .$ docker run --rm -d --name battleship -p 1234:1234 battleshipYou can use the following environment variables for specifying the game settings:
BATTLESHIP_SOCKET: TCP socket address (default:127.0.0.1:1234)BATTLESHIP_GRID_WIDTH: Width of the game grid (default:10)BATTLESHIP_GRID_HEIGHT: Height of the game grid (default:10)
After joining the game, players take turns firing shots (by calling out a grid coordinate) to attempt to hit the opponent's enemy ships. Example coordinates would bea1,g8,E4,I2, and so on.
Each player has two grids: an upper and lower grid.
The lower grid views the location of the player's own ships, while the upper grid shows the shots fired toward the opponent and also gives information about whether those shots were hits or misses.
☒: hit✕: missed
- Boat
△- Destroyer
▯▯- Battleship
▧▧▧▧▧▧About
Battleship game implemented in Rust
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.


