fill(bitboard, value, littleEndian?)

Fills the quadrille based on a bitboard pattern passed as a JavaScript BigInt. Each 1 bit in the binary representation corresponds to a filled cell with the given value. The bitboard is read in row-major order, using big-endian by default.

Note

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

Example

(click to toggle the smiley bitboard pattern)

edit, then run

Warning

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

Syntax

fill(bitboard, value[, littleEndian])

Parameters

Param Description
bitboard BigInt: A bitboard whose binary representation determines the filled cells
value Any: A valid JavaScript value (e.g. string, number, object, function) to assign to filled cells
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.