Neg

neg() #

Returns a new quadrille by clearing q filled cells, and filling q empty cells with value (any data type instance but undefined).

Example #

(click on the canvas and press any key)

code
Quadrille.cellLength = 60;
let q;
let west;

function setup() {
  createCanvas(300, 240);
  q = createQuadrille(5, 4, 8, '🌏');
}

function draw() {
  background('purple');
  drawQuadrille(q);
}

function keyPressed() {
  west = !west;
  q = Quadrille.neg(q, west ? '🌎' : '🌏');
}

Syntax #

Quadrille.neg(quadrille, value)

Parameters #

paramdescription
quadrille1Quadrille: first quadrille to merge
quadrille2Quadrille: second quadrille to merge
rowNumber: The vertical displacement of quadrille2 relative to quadrille11. Negative values are allowed
colNumber: The horizontal displacement of quadrille2 relative to quadrille12. Negative values are allowed

  1. Default is row2 - row1 if both quadrille1 and quadrille2 are drawn, or 0 otherwise. ↩︎

  2. Default is col2 - col1 if both quadrille1 and quadrille2 are drawn, or 0 otherwise. ↩︎