Law of Clousure and Multistable Perception in a grid

P5.js, Law of Proximity, Law of Multistable Perception, grid
This sample shows a dynamic grid, that changes the width and height of itself.

The grid changes the size of the rectangles that are built through the grid each time by clicking the updating button. It is a non symetric drawn horizontal and vertical line canvas, that makes it interesting for drawing sheet.

function setup() {
   var canvas = createCanvas(500, 500);
  for(var x = random(500); x > 0.1; x /= 1.1) {
    line(0, x, 500, x);
    line(x, 500, x, 0);

function draw() {