fill(predicate, value)

Fills cells matching a predicate condition with the specified value.

Example

(move the mouse to fill empty cells in the current row with 🐉; click to reset)

edit, then run

Syntax

fill(predicate, value)

Parameters

Param Description
predicate Function: A predicate function ({ row, col, value }) => boolean selecting cells to fill
value1 Any: A valid JavaScript value
  1. A plain function value is stored, not called — it becomes a per-cell display routine ({ row, col, options }) => { ... } (see options). To have a function evaluated per cell at fill time — a fresh object or a varied tile per cell — tag it: Quadrille.factory(({ row, col }) => new Object(...)). ↩
What this page's examples use
p5.quadrille
drawQuadrille createQuadrille cellLength mouseRow rand fill
p5.js
createCanvas background color

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.