Skip to content

Latest commit

 

History

History
72 lines (55 loc) · 1.29 KB

README.md

File metadata and controls

72 lines (55 loc) · 1.29 KB

polyomino

node.js library for working with all kinds of polyominoes.

npm install polyomino

API

Free, one-sided and fixed polyominoes are all supported:

  • get(n): return a Set of fixed polyominoes of order n.
  • OneSided(n): return a Set of one-sided polyominoes of order n.
  • Free(n): return a Set of free polyominoes of order n.

Examples

$ node -e 'require("polyomino").OneSidedPolyomino.get(4).forEach(item => console.log(`${item.render()}\n`));'
██  
████
██  

██  
██  
████

████
████

████  
  ████

████
██  
██  

██  
████
  ██

██
██
██
██
$ node -e 'require("polyomino").Polyomino.get(10).first().rotations().forEach(item => console.log(`${item.render()}\n`));'
  ████
  ██  ██
██████████
      ██

    ██
  ██████
██  ██
██████
    ██

  ██
██████████
  ██  ██
    ████

  ██
  ██████
  ██  ██
██████
  ██