clear(bitboard, littleEndian?)

Clears the cells of the quadrille according to a bitboard passed as a JavaScript BigInt. Each 1 bit in the binary representation corresponds to a cell to be cleared (set to null). The bitboard is read in row-major order, using big-endian by default.

Note

To use little-endian ordering instead, pass true as the second argument.

Example

(click to toggle clearing the smiley pattern)

edit, then run

Warning

The bitboard must be a BigInt (note the n suffix: 0b0011100n). A plain Number is dispatched as clear(row) instead — silently clearing a row, not a pattern.

Syntax

clear(bitboard[, littleEndian])

Parameters

Param Description
bitboard BigInt: A bitboard whose binary 1 bits indicate the cells to clear
littleEndian Optional Boolean: If true, the bitboard is interpreted in little-endian order (default is false)
What this page's examples use
p5.quadrille
drawQuadrille createQuadrille cellLength fill clear
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.