1.2.0 • Published 1 year ago

sierpinski-curve-cli v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

sierpinski-curve-cli

Print the Sierpinski (Square) Curve to the console!

What sierpinski-curve-cli prints to the console

npm version bundle size downloads license

Why the console? Because it's the cool way.

See All Fractals in the fractals-cli project.

Usage

Via npx:

$ npx sierpinski-curve-cli <n>
$ npx sierpinski-curve-cli <n> [options]

where n >= 0.

Via Global Install

$ npm install --global sierpinski-curve-cli
$ sierpinski-curve-cli <n>
$ sierpinski-curve-cli <n> [options]

where n >= 0.

Via Import

$ npm install sierpinski-curve-cli

then:

const sierpinski = require('sierpinski-curve-cli');
console.log(sierpinski.create(<n>);
console.log(sierpinski.create(<n>, { 
    line: <bold|double|standard> 
});

The config params are optional.

Options

Recursive Step

$ sierpinski-curve-cli <n>

The first param <n> is the recursive step. <n> should be an integer greater than or equal to 0.

Examples:

$ sierpinski-curve-cli 2

What sierpinski-curve-cli prints to the console

$ sierpinski-curve-cli 3

What sierpinski-curve-cli prints to the console

Line Type

$ sierpinski-curve-cli <n> --line=<bold|double|standard>

The optional --line param draws the Sierpinski Curve using different line types. Supported values:

  • bold: Draw using bold lines
  • double: Draw using double lines
  • standard: Draw using standard lines (default)

Examples:

$ sierpinski-curve-cli 3 --line=bold

What sierpinski-curve-cli prints to the console

$ sierpinski-curve-cli 3 --line=double

What sierpinski-curve-cli prints to the console

Related

Main Project

Fractal Shapes

Fractal Patterns

Space Filling Curves

License