1.0.1 • Published 5 years ago

@burntcoffee/flood-fill v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

FloodFill

An efficient implementation of the Flood Fill algorithm in javascript.

Install

$ npm install @burntcoffee/flood-fill

Usage

const floodFill = require('@burntcoffee/flood-fill');

let matrix = [
    [1, 0, 0, 0, 1, 0, 0],
    [1, 1, 0, 1, 0, 0, 1],
    [0, 1, 1, 1, 1, 0, 0]
];

matrix = floodFill(matrix, 0, 0, 3);

The floodFill() function expects a two dimensional array of strings or integers, the x and y positions of the target, and the value that will replace the target.

1.0.1

5 years ago

1.0.1-0

5 years ago

1.0.0

5 years ago