1.0.0 • Published 4 years ago
blokus-piece-describer v1.0.0
Blokus piece describer
For the hackathon project with Abhi:
Usage:
const { type, getAllLabels, toString } = require('blokus-piece-describer');
const piece = getAllLabels([
[type.block, type.block, type.empty],
[type.empty, type.block, type.empty],
[type.empty, type.block, type.block],
]);
getAllLabels(piece)
.forEach(labeledPiece => {
console.log(toString(labeledPiece);
});
// output:
// *--*
// -██-
// *-█-*
// -██-
// *--*
// *-*
// *--█-
// -███-
// -█--*
// *-*
// *--*
// -██-
// *-█-*
// -██-
// *--*
// *-*
// -█--*
// -███-
// *--█-
// *-*
License
MIT License
1.0.0
4 years ago