Module: Board

Methods

(inner) distanceBetween(a, b) → {integer|null}

Parameters:
Name Type Description
a array The co-ordinates of A
b array The co-ordinates of B
Source:
Returns:
The distance (as the crow flies) between 2 co-ordinates
Type
integer | null

(inner) findAllAt(xy) → {array}

Parameters:
Name Type Description
xy array An array of co-ordinates [[x, y], [x, y]]
Source:
Returns:
An array with co-ordinates replaced with string representations of entities or null
Type
array

(inner) findAt(xy) → {string|null}

Parameters:
Name Type Description
xy array co-ordinates [x, y]
Source:
Returns:
A string representation of an entity
Type
string | null

(inner) findClosest(xy, entity) → {array|null}

Parameters:
Name Type Description
xy array The co-ordinates [x, y]
entity string A string representation of an entity
Source:
Returns:
Return co-ordinates [x, y] of the closest entity to xy
Type
array | null

(inner) findNeighbours(xy, steps) → {array}

Parameters:
Name Type Description
xy array co-ordinates [x, y]
steps integer How many steps away
Source:
Returns:
An array neighbours of co-ordinates at `steps` away
Type
array

(inner) printMap() → {void}

Source:
Returns:
Prints map to stdout
Type
void