https://github.com/naomiyocum/battleship
A CLI Battleship game - you vs the computer.
https://github.com/naomiyocum/battleship
rspec ruby
Last synced: 3 months ago
JSON representation
A CLI Battleship game - you vs the computer.
- Host: GitHub
- URL: https://github.com/naomiyocum/battleship
- Owner: naomiyocum
- Created: 2022-08-29T22:25:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-13T21:25:40.000Z (over 2 years ago)
- Last Synced: 2025-02-03T11:50:50.623Z (4 months ago)
- Topics: rspec, ruby
- Language: Ruby
- Homepage:
- Size: 40 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Battleship 🚢



## Table of contents
* [General Info](#general-info)
* [Learning Goals](#learning-goals)
* [Technologies](#technologies)
* [Usage](#usage)## General Info
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](https://en.wikipedia.org/wiki/Battleship_(game)).
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”.## Learning Goals
* 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## Technologies
* Ruby 2.7
* RSpec
* Pry
* SimpleCov
* Git
* Atom## Usage :ship:
You need to clone the project onto your local machine and run the file.
```bash
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.