moore-curve-cli

1.2.0 • Public • Published

moore-curve-cli

Print the Moore Curve to the console!

What moore-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 moore-curve-cli <n>
$ npx moore-curve-cli <n> [options]

where n >= 1.

Via Global Install

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

where n >= 1.

Via Import

$ npm install moore-curve-cli

then:

const moore_curve = require('moore-curve-cli');
console.log(moore_curve.create(<n>);
console.log(moore_curve.create(<n>, { 
    closed: <boolean>,
    rotation: <left|right|flip|standard>,
    line: <bold|double|standard> 
});

The config params are optional.

Options

Recursive Step

$ moore-curve-cli <n>

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

Examples:

$ moore-curve-cli 3

What moore-curve-cli prints to the console

$ moore-curve-cli 4

What moore-curve-cli prints to the console

Closed Curve

$ moore-curve-cli <n> --closed

The optional --closed param (or shorthand -c) will draw a closed Moore Curve.

Examples:

$ moore-curve-cli 4 --closed

What moore-curve-cli prints to the console

Rotation

$ moore-curve-cli <n> --rotate=<left|right|flip|standard>

The optional --rotate param rotates the Moore Curve. Supported values:

  • left: Rotate left 90 degrees
  • right: Rotate right 90 degrees
  • flip: Rotate 180 degrees
  • standard: No rotation (default)

Example:

$ moore-curve-cli 4 --rotate=right

What moore-curve-cli prints to the console

$ moore-curve-cli 4 --rotate=flip

What moore-curve-cli prints to the console

$ moore-curve-cli 4 --rotate=left

What moore-curve-cli prints to the console

Line Type

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

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

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

Examples:

$ moore-curve-cli 4 --line=bold

What moore-curve-cli prints to the console

$ moore-curve-cli 4 --line=double

What moore-curve-cli prints to the console

Related

Main Project

Fractal Shapes

Fractal Patterns

Space Filling Curves

License

Package Sidebar

Install

npm i moore-curve-cli

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

17.3 kB

Total Files

5

Last publish

Collaborators

  • spirometaxas