Team Incas : Catherina, Hannah, Jeremy, Peter
Ruby 2.1.2
Create an interactive battleships game that can be played through the terminal
Battleships is a two player game. Each player deploys 5 ships on a 10 x 10 grid. Each cell has a unique grid reference. Each player takes turns to call out a grid reference and the other players confirms whether it is a ‘hit’ or ‘miss’ if a ship is at that grid reference or not. The attacking players marks the ‘hit’ or ‘miss’ on their tracking grid. The defending player marks ‘hit’ or ‘miss’ on their primary grid. Players alternate turns. When every cell that comprises one ship has been ‘hit’, the defending player declares it sunk. When a player sinks all their opponent’s ships they win and the game ends.
- Grid: holds a collection of ships and cells
- Cell: unit on the grid which holds either water or a ship
- Attacked Cell: cell that has been attacked
- Ship: has a shield level and can be sunk
- Water: content of a cell with no ship
- Hit: generated by an attack on a cell with a ship
- Miss: generated by an attack on a cell holding water
- Player: can place ships on the grid and attack opponent cells
- Game: control the flow of the game
$ ruby lib/play.rb from root
$ rspec from root