The game of Battleship written in Rust.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
misc
src
.gitignore split up code into files Feb 26, 2017
Cargo.toml
README.md

README.md

Battleship ... in Rust.

Game Screenshot

This is the game of Battleship written in Rust.

I wrote this while trying to learn Rust, so pardon the nieve implementations.

I'll have a post up at https://ls3.io about the experience soon.

Running the Game

You must have Rust installed.

cargo build
cargo run

Rules of Battleship

Board:

  • horizontally by letters A through I
  • vertically by numbers 1 through 10

Ships:

  • Aircraft carrier: 5 spaces
  • Battleship: 4 spaces
  • Destroyer: 3 spaces
  • Submarine: 3 spaces
  • Patrol: 2 spaces

Game Play

  • When you start a game, the Ships are randomly placed on your board (and the computer's board).
  • You get prompted for coordinates for your next torpedo.
  • As you build up hits/misses, you start to hone in on the enemy ships.
  • Sink all the ships to win the game.