lluiscamino / battleship.js

Battleship JavaScript game

Home Page:https://lluiscamino.github.io/battleship.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Battleship JavaScript game

https://lluiscamino.github.io/battleship.js/

License:MIT License


Languages

Language:JavaScript 86.0%Language:HTML 7.8%Language:CSS 6.3%