createQuadrille(width, array)
The createQuadrille(width, array) function creates a quadrille with a specified number of columns (width) and fills its cells using items from the provided array. The items are arranged sequentially across the specified columns, creating one or more rows as needed. The array can contain any combination of valid JavaScript values, with null representing empty cells — holes and explicit undefined normalize to null on entry, and the last row pads with null if the array doesn't divide evenly.
Example
Note
The
createQuadrille(width, array)function lets you specify the number of columns (width) while filling the quadrille with items from the providedarray. Items are arranged sequentially into rows, and anynullvalues represent empty cells. For handling the values, refer to createQuadrille(jagged_array).
Syntax
createQuadrille(width, array)
Parameters
| Param | Description |
|---|---|
width |
Number: The total number of columns for the quadrille |
array |
An array containing any combination of valid JavaScript values. Use null to represent empty cells (holes and undefined normalize to null) |
What this page's examples use
- p5.quadrille
drawQuadrillecreateQuadrillecellLength- p5.js
createCanvasbackgroundcolorloadImage
Names the analysis can prove are called, and the line each one is documented on. Local variables and members of an unknown receiver are left out.