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 |
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]] |
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] |
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 |
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 |
Returns:
An array neighbours of co-ordinates at `steps` away
- Type
- array
(inner) printMap() → {void}
Returns:
Prints map to stdout
- Type
- void