Skip to content

julio22b/battleship

Repository files navigation

Battleship

Demo

https://julio22b.github.io/battleship/

Installation

Clone this project locally and run:

npm install

Tests

To run the tests use:

npm run test

Pictures

preview

In this project I practised Test Driven Development using Jest and Object Oriented Programming. The goal was to create the main Factory Functions and test their proper functionality. It was built with HTML, CSS and Javascript.

It can be played against the computer or a friend (best on mobile).

By clicking '1 player' the user is taken to a ship placement screen where they can click on a cell or type a coordinate to place the specified ship.

preview

By click '2 players' the first player is asked to place their ships, when finished the first player's gameboard will be hidden and the second player will be asked to place their ships. The first player starts the game and a screen that covers both gameboards and says who goes next is displayed, at which moment the player passes the device to the corresponding player.

License

MIT