sierpinski-hexagon-cli

1.3.0 • Public • Published

sierpinski-hexagon-cli

Print the Sierpinski Hexagon to the console!

What sierpinski-hexagon-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-hexagon-cli <n>
$ npx sierpinski-hexagon-cli <n> [size] [options]

where n >= 0 and size >= n (if provided).

Via Global Install

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

where n >= 0 and size >= n (if provided).

Via Import

$ npm install sierpinski-hexagon-cli

then:

const sierpinski = require('sierpinski-hexagon-cli');
console.log(sierpinski.create(<n>));
console.log(sierpinski.create(<n>, { 
    size: <number>, 
    character: <character> 
}));

The config params are optional.

Options

Recursive Step

$ sierpinski-hexagon-cli <n>

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

Examples:

$ sierpinski-hexagon-cli 2

What sierpinski-hexagon-cli prints to the console

$ sierpinski-hexagon-cli 3

What sierpinski-hexagon-cli prints to the console

Size

$ sierpinski-hexagon-cli <n> [size]

The optional [size] param allows the Sierpinski Hexagon to be drawn at larger sizes. [size] should be an integer greater than or equal to <n>. Including size will draw a Sierpinski Hexagon of <n> recursive steps the size of a hexagon with [size] recursive steps.

Example:

$ sierpinski-hexagon-cli 2 3

What sierpinski-hexagon-cli prints to the console

Custom Characters

$ sierpinski-hexagon-cli <n> --character=<character>

The optional --character=<character> param will draw hexagons using the provided character. (Please provide only 1 character)

Example:

$ sierpinski-hexagon-cli 1 3 --character=*

What sierpinski-hexagon-cli prints to the console

Related

Main Project

Fractal Shapes

Fractal Patterns

Space Filling Curves

License

Package Sidebar

Install

npm i sierpinski-hexagon-cli

Weekly Downloads

6

Version

1.3.0

License

MIT

Unpacked Size

14.1 kB

Total Files

5

Last publish

Collaborators

  • spirometaxas