sketch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Constants
// Cell initialization

function setup() {
  // Setup boilerplate

  for (let i=0;i<20;i++) {
    cells[cellIndex(i, i)] = 1;
  }
  renderCells();
}

function cellIndex(x, y) {
  return (y * COLUMNS) + x;
}

// renderCells()
Preview