Delete

delete() #

Deletes a row from the quadrille.

Example #

(click on any cell; press any key to reset)

code
Quadrille.cellLength = 20;
let quadrille;

function setup() {
  createCanvas(400, 400);
  reset();
}

function draw() {
  background('orange');
  drawQuadrille(quadrille);
}

function mouseClicked() {
  quadrille.delete(quadrille.mouseRow);
}

function keyPressed() {
  reset();
}

function reset() {
  quadrille = createQuadrille(20, 20, 100, color('red'));
  quadrille.rand(100, color('green')).rand(100, color('blue')).
            rand(100, color('cyan'));
}

Syntax #

delete(row)

Parameters #

parameterdescription
rowNumber: number of row to be deleted [0..height]