polyomino
v0.0.1-3
Published
polyomino
Downloads
49
Readme
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 ordern
.OneSided(n)
: return a Set of one-sided polyominoes of ordern
.Free(n)
: return a Set of free polyominoes of ordern
.
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`));'
████
██ ██
██████████
██
██
██████
██ ██
██████
██
██
██████████
██ ██
████
██
██████
██ ██
██████
██