MCPcopy Create free account
hub / github.com/MultithreadedJSBook/code-samples / paint

Function paint

ch5-game-of-life/gol.js:57–59  ·  view source on GitHub ↗
(cell, x, y)

Source from the content-addressed store, hash-verified

55const buf = new Uint32Array(data.data.buffer);
56
57function paint(cell, x, y) { // <4>
58 buf[SIZE * x + y] = cell ? BLACK : WHITE;
59}
60
61const grid = new Grid(SIZE, new ArrayBuffer(2 * SIZE * SIZE), paint); // <5>
62for (let x = 0; x < SIZE; x++) { // <6>

Callers 1

gol.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected