1.0.6 • Published 6 years ago

@finding-islands/core v1.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

Finding Islands, Core

This package implements the algorithms to find the islands in a sea.

The sea is a bi-dimensional array of integers. Water is represented by the value 0.

An island is an array of coordinates.

Example

findIslands([
  [land, land, water, land, water],
  [water, land, water, land, land],
  [water, land, land, water, water],
  [land, land, water, water, land]
]);
[
  ([
    { x: 0, y: 0 },
    { x: 0, y: 1 },
    { x: 1, y: 1 },
    { x: 2, y: 1 },
    { x: 2, y: 2 },
    { x: 3, y: 0 },
    { x: 3, y: 1 }
  ],
  [{ x: 0, y: 3 }, { x: 1, y: 3 }, { x: 1, y: 4 }],
  [{ x: 3, y: 4 }])
];
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago