Battleship was a paired project assigned to us during week 2 of Mod 1 of 4 in Turing's School of Software & Design.
Our challenge was to use Ruby to build a command line implementation of the classic game Battleship.
Battleship is a classic board game where players place one or more ships on a grid board, and then take turns trying to “sink” the other player’s ships by guessing their coordinates.
The game ends when one player’s ships are all hit and “sunk”.
- Utilize Test-Driven Development (TDD)
- Practice algorithmic thinking
- Create an Object-Oriented solution to a problem without being given full specifications
- Work in a pair, using Pull Requests to collaborate
- Ruby 2.7
- RSpec
- Pry
- SimpleCov
- Git
- Atom
You need to clone the project onto your local machine and run the file.
git clone [email protected]:naomiyocum/battleship.git
cd battleship
ruby battleship_runner.rb
After running these commands, you should see a prompt welcoming you to the game!
After entering p
, you will be prompted to place your ships, similar to the image below.
After ship placement, you and the computer will take turns attempting to hit each other's battleships. May the odds be in your favor.