Skip to content

spirometaxas/triflake-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

triflake-cli

Print the Triflake Fractal to the console!

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

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

Via Global Install

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

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

Via Import

$ npm install triflake-cli

then:

const triflake = require('triflake-cli');
console.log(triflake.create(<n>));
console.log(triflake.create(<n>, { 
    size: <number>, 
    rotate: <flip|standard>,
    character: <character> 
}));

The config params are optional.

Options

Recursive Step

$ triflake-cli <n>

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

Examples:

$ triflake-cli 2

What triflake-cli prints to the console

$ triflake-cli 3

What triflake-cli prints to the console

Size

$ triflake-cli <n> [size]

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

Example:

$ triflake-cli 2 3

What triflake-cli prints to the console

Rotation

$ triflake-cli <n> --rotate=<flip|standard>

The optional --rotate param rotates the Triflake. Supported values:

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

Example:

$ triflake-cli 3 --rotate=flip

What triflake-cli prints to the console

Custom Characters

$ triflake-cli <n> --character=<character>

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

Example:

$ triflake-cli 1 3 --character=*

What triflake-cli prints to the console

Related

Main Project

Fractal Shapes

Fractal Patterns

Space Filling Curves

License

About

Print the Triflake Fractal to the console!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published