getPathLength

getPathLength

> Functions

Returns the length of the shortest path between two cells cell1 and cell2 that avoids obstacles, ignoring the cells contained in the array ignoredCells. This function is equivalent to count(getPath(cell1, cell2, ignoredCells)). If a player stands on an ignored cell, the path can go through them.

The starting cell cell1 is never counted in the result. The cell cell2 is counted in the result if and only if it is empty or ignored by ignoredCells.

If no path exists between the two cells, getPathLength returns null.

Parameters
Return