createQuadrille(width, height, order, value)

Creates a quadrille and fills its cells using the specified value, which is randomly repeated throughout the quadrille up to order number of times. The dimensions of the quadrille are determined by width and height.

Example #

code
let quadrille;

function setup() {
  createCanvas(6 * Quadrille.cellLength, 4 * Quadrille.cellLength);
  quadrille = createQuadrille(6, 4, 13, 150);
}

function draw() {
  background('orange');
  drawQuadrille(quadrille);
}
To define different values in createQuadrille(width, height, order, value), refer to createQuadrille(jagged_array).

Syntax #

createQuadrille(width, height, order, value)

Parameters #

ParamDescription
widthNumber: The total number of columns for the quadrille
heightNumber: The total number of rows for the quadrille
orderNumber: The number of non-empty cells to be filled with the value
valueAny: valid JavaScript value, with null representing empty cells