A simple Battleship game wrote in JavaScript.
-
There are 5 types of boats and 7 boats in total:
Game.numBoatTypes = 5; Game.numBoatsPerType = [0, 2, 2, 1, 1, 1];
- 2 boats occupying 1 cell
- 2 boats occupying 2 cells
- 1 boat occupying 3 cells
- 1 boat occupying 4 cells
- 1 boat occupying 5 cells
-
Boats have to be placed horizontally or vertically
-
Boats cannot be placed outside the 10x10 grid
-
Boats cannot be placed on another boat or around it (every boat has to be distanced one cell from the rest of the boats)