An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        

Battleship 🚢

![GitHub Contributors](https://img.shields.io/github/contributors/naomiyocum/battleship)
![GitHub language count](https://img.shields.io/github/languages/count/naomiyocum/battleship)
![GitHub top language](https://img.shields.io/github/languages/top/naomiyocum/battleship?color=yellow)

drawing

## 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.


Screen Shot 2022-11-16 at 12 11 44 PM


After ship placement, you and the computer will take turns attempting to hit each other's battleships. May the odds be in your favor.