Cell Contents

These methods focus on determining the value and type of cells at a specific (row, col) position:

Example

(hover over a cell to view its contents)

edit, then run

Note

  • This example builds on the createQuadrille(jagged_array) approach—check it out to understand the foundation.
  • Dynamic Quadrille Methods: The cellType and cellValue methods are appended to the quadrille object, allowing runtime customization without requiring subclasses. These methods leverage most of the cell content accessors discussed in this section (is* methods for type checking and read(row, col) for value retrieval, respectively).
  • Positioning in displayCellDetails: Text positioning dynamically accounts for canvas centering and padding; abstracting this logic can simplify reuse.
  • Interactive Features: A checkbox toggles between displaying cell type or value, while the pulse function provides animated cell feedback.

14 pages

read(row, col)

isValid(row, col)

isEmpty(row, col)

isFilled(row, col)

isBoolean(row, col)

isNumber(row, col)

isBigInt(row, col)

isString(row, col)

isColor(row, col)

isImage(row, col)

isArray(row, col)

isFunction(row, col)

isObject(row, col)

isSymbol(row, col)

What this page's examples use
p5.quadrille
drawQuadrille createQuadrille cellLength mouseRow mouseCol isValid
p5.js
createCanvas background color loadImage text position fill createCheckbox checked height noStroke map frameCount circle sin
JavaScript
String Symbol

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.