createQuadrille(width, height, order, value)
Creates a quadrille of dimensions width × height and randomly places value in exactly order cells (clamped to the board size).
Example
Note
The
orderargument means exactly what the order property means — the number of filled cells: aftercreateQuadrille(6, 4, 13, 150),q.order === 13. Values beyond the board size clamp:createQuadrille(2, 2, 99, value)fills all 4 cells.
Note
To define different values in
createQuadrille(width, height, order, value), refer to createQuadrille(jagged_array).
Syntax
createQuadrille(width, height, order, value)
Parameters
| Param | Description |
|---|---|
width |
Number: The total number of columns for the quadrille |
height |
Number: The total number of rows for the quadrille |
order |
Number: The number of cells to fill with value — the resulting order property (clamps to width × height) |
value1 |
Any: valid JavaScript value, with null representing empty cells |
What this page's examples use
- p5.quadrille
drawQuadrillecreateQuadrillecellLength- p5.js
createCanvasbackground
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.