Skip to content

tabone/noci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOCI

NOCI NOCI NOCI

Procedural Avatar Generator

npm version License: MIT

Click Here For Demo


Install

NPM

npm install --save noci

Yarn

yarn add noci

Usage

  const grid = require('noci')({
    width: 10,
    height: 10,
    iterations: 10,
    seed: 'random-seed',
    fold: 'VERTICAL' // Can also be 'HORIZONTAL' or 'BOTH'
  })

  grid.forEach(
    (rows, y) => {
      rows.forEach(
        (cell, x) => {
          switch (cell) {
            case 'ALIVE' {
              // Paint pixel at (`x`, `y`) with skin color.
              break;
            }
            case 'CONTOUR': {
              // Paint pixel at (`x`, `y`) with border color.
              break;
            }
            default: { // or 'DEAD'
              // Paint pixel at (`x`, `y`) with background color.
              break;
            }
          }
        }
      )
    }
  )

References

Based on the algorithm by yurkth.

About

Procedural Icon Generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published