Skip to content

lluiscamino/battleship.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

battleship.js

Scrutinizer Code Quality Build Status License: MIT

Description

A simple Battleship game wrote in JavaScript.

Rules

  1. There are 5 types of boats and 7 boats in total:

    Game.numBoatTypes = 5;
    Game.numBoatsPerType = [0, 2, 2, 1, 1, 1];
    1. 2 boats occupying 1 cell
    2. 2 boats occupying 2 cells
    3. 1 boat occupying 3 cells
    4. 1 boat occupying 4 cells
    5. 1 boat occupying 5 cells
  2. Boats have to be placed horizontally or vertically

  3. Boats cannot be placed outside the 10x10 grid

  4. Boats cannot be placed on another boat or around it (every boat has to be distanced one cell from the rest of the boats)

Built with

Play

Click here to play