Quadrille.chessKeys
The reverse of Quadrille.chessSymbols: a new Map from the drawn value back to its FEN letter, so a cell can be asked what piece it holds without knowing the skin. Rebuilt on every read, from the current map — a custom symbol appears here as soon as it is assigned.
Example
Note
Click the sketch to see the reverse map follow the forward one:
👸appears where♛was, because the getter rebuilds from the current symbols. A cell drawn with a custom symbol is read back withQuadrille.chessKeys.get(value).
What this page's examples use
- p5.quadrille
chessSymbolschessKeys- p5.js
createCanvasbackgroundtextkeyfilltextFonttextSizenoLoopredraw
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.