Class: Ship

Ship(type, dimension, coordinates)

Ship

Constructor

new Ship(type, dimension, coordinates)

Parameters:
Name Type Description
type string This defines the type of the ship "P" & "Q"
dimension Array Represnts the dimension of the ship
coordinates Array Represnts the coordinates of the ship
Source:

Methods

bombard() → {null}

Function to bombard the ship
Source:
Returns:
returns nothing
Type
null

isDestroyed() → {Boolean}

Function to check if the ship is destroyed
Source:
Returns:
returns true if ship is destroyed else false
Type
Boolean