clone()
Returns a shallow copy of the quadrille.
Example
(click on canvas and / or press any key)
Note
Shallow means cell values are shared references. Clicking mutates the shared
color1instance in place — both quadrilles change together, since their cells point at the same object. Pressing a key instead replacescolor2in the twin only with a fresh instance — the original keeps the old one. Same identity story as fill(value) and strict search.
Syntax
clone()
What this page's examples use
- p5.quadrille
drawQuadrillecreateQuadrillecellLengthclone- p5.js
createCanvasbackgroundcolorrandom
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.