Skip to content

wjordan/polyomino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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`));'
  ████
  ██  ██
██████████
      ██

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

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

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

About

polyomino algorithms for node.js

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published