qr-jenga
v1.0.0
Published
QR jenga library
Downloads
2
Readme
QR Jenga
QR Jenga is a game.
Rule
- Draw QR.
- Player remove a black block.
- Check QR readable.
- readable -> 2 / no -> 5
- Last player lose.
Usage
Install
npm install qr-jenga
# yarn add qr-jenga
# pnpm add qr-jenga
Use
import { createQrJenga } from 'qr-jenga';
// create game
const qrJenga = createQrJenga('QR TEXT');
// remove block
const [x, y] = [0, 0];
const success = qrJenga.remove(x, y);
// check collapse(readable)
if (success) {
console.log('readable!');
// -> next step!
} else {
console.log('COLLAPSE!');
}
// render
for (let x = 0; x < qrJenga.size; x++) {
for (let y = 0; y < qrJenga.size; y++) {
const pixelIsBlack = qrJenga.get(x, y);
// render pixel
}
}
LICENSE
MIT