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 #
param | description |
---|---|
quadrille1 | Quadrille: first quadrille to merge |
quadrille2 | Quadrille: second quadrille to merge |
row | Number: The vertical displacement of quadrille2 relative to quadrille1 1. Negative values are allowed |
col | Number: The horizontal displacement of quadrille2 relative to quadrille1 2. Negative values are allowed |