1.3.0 • Published 1 year ago

koch-snowflake-cli v1.3.0

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

koch-snowflake-cli

Print the Koch Snowflake to the console!

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

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

Via Global Install

$ npm install --global koch-snowflake-cli
$ koch-snowflake-cli <n>
$ koch-snowflake-cli <n> [size] [options]

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

Via Import

$ npm install koch-snowflake-cli

then:

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

The config params are optional.

Options

Recursive Step

$ koch-snowflake-cli <n>

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

Examples:

$ koch-snowflake-cli 2

What koch-snowflake-cli prints to the console

$ koch-snowflake-cli 3

What koch-snowflake-cli prints to the console

Size

$ koch-snowflake-cli <n> [size]

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

Example:

$ koch-snowflake-cli 2 3

What koch-snowflake-cli prints to the console

Custom Characters

$ koch-snowflake-cli <n> --character=<character>

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

Example:

$ koch-snowflake-cli 1 3 --character=*

What koch-snowflake-cli prints to the console

Related

Main Project

Fractal Shapes

Fractal Patterns

Space Filling Curves

License