Grid

Grid

Create a grid through which robots can move

Constructor

new Grid(length, height)

Source:
Parameters:
Name Type Default Description
length Number 0

The length of the grid

height Number 0

The height of the grid

Throws:
  • Will throw an error if length or height are greater than 50

    Type
    Error
  • Will throw an error if length or height are smaller than 0

    Type
    Error

Methods

addForbiddenPosition(position)

Adds a position to the array of forbidden's positions

Source:
Parameters:
Name Type Description
position String

hasForbidden(position) → {boolean}

Check if a position is forbidden

Source:
Parameters:
Name Type Description
position String
Returns:
Type:
boolean