toBitboard(littleEndian?)

Returns a bitboard—encoded as a JavaScript BigInt—that represents the filled cells of the quadrille.

Each 1 bit marks a filled cell and 0 an empty one. Cells are encoded in row-major order, and by default, use big-endian layout (top-left cell is the most significant bit).

Use littleEndian = true to reverse the bit order, so the top-left cell becomes the least significant bit. This is common in some chess engines and low-level systems.

Syntax #

toBitboard([littleEndian])

Parameters #

ParamDescription
littleEndianOptional Boolean: If true, uses little-endian encoding (default is false, i.e., big-endian)