-
-
-
Created via a factory function.
-
10x10
-
Places ships at specific coordinates by calling ship factory function.
-
-
- Takes a pair of coordinates, and if the attack hits any ships, send a hit function to the correct ship, if shot missed then record it's coordinates.
-
- Calls isSunk function on all ships.
-
-
-
-
Created via a factory function.
-
- Length
- shipArray that starts as an empty array the same length as the ships Length.
-
- Takes a number as an argument, and marks that position as hit.
-
- Calculates based on length and if all positions of the ship have been hit.
-
-
- Created via a factory function
- Players take turns playing the game by attacking enemy gameboard.
- Enemy player is a computer, give it a basic AI (random plays that are legal).
-
- Contains all functions for DOM manipulation.
- Display both gameboards.
-
-
Sets up a game by creating players and gameboards. Gameboards should have predetermined coordinates to begin with.
-
Method to render gameboards using functions from the DOM module.
-
Method to take tuser input for attacking via a click on a coordinate.
-
Condition for game to end once all ships of one player has been sunk. (This function can be defined in game loop module)
-
-