bingo-blower.js
demo
Return Home
bingo-blower.js
is available on GitHub.
The ball drawn is:
HTML:
<button type="button" id="draw">Draw a ball</button>
<button type="button" id="reset">Reset the Blower</button>
<canvas class="blower" id="world"></canvas>
The ball drawn is: <span id="result"></span>
JS:
let blower = new BingoBlower();
blower.addBalls([18, 6, 3]);
document.getElementById('draw').addEventListener('click',
async () => {
const draw = await blower.drawBall();
document.getElementById('result').innerHTML = draw.colourHuman;
}
);
document.getElementById('reset').addEventListener('click',
() => {
blower.reset();
}
);