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 |
Methods
bombard() → {null}
Function to bombard the ship
Returns:
returns nothing
- Type
- null
isDestroyed() → {Boolean}
Function to check if the ship is destroyed
Returns:
returns true if ship is destroyed else false
- Type
- Boolean