The Battleship is an application which implements Battleship (game) in Ruby language. This document contains implementation notes and gotcha's.
-
You can use the game like in the following file: console.rb
-
You could test/play by yourself in interactive mode/console by typing
ruby lib/console.rb
-
The ships cannot overlap (i.e., only one ship can occupy any given square in the grid). This is game variant when ships can tauch only diagonal.
bad
.......... ..XXX..... ....XXX... ..........
bad
.......... ..XXXXXX.. .......... ..........
good
.......... ..XXX..... .....XXX.. ..........
-
Application allow a single human player to play a one-sided game of battleships against the computer.
-
If computer's ship is sinking then message like 'You sank my Aircraft carrier' arise.
-
D - debug mode
-
I - initialize game again with new fleet
-
Q - quit
Test coverage can be observed in the badge on the top of this file. You can inspect them running
bundle exec rspec
-
Game ends when you destory all the enemy's ships
-
Game ends when you type command 'Q'
Contributors are welcome but please note that
-
we follow the community-driven Ruby coding style guide here.
-
tests (rspec) should work when you are ready with your PR ๐