A generic rectangular grid of pieces - the shared shape underneath a game-specific board
(chess, checkers, or a custom game entirely) that only needs cells, bounds checking, and
moving a piece from one cell to another.
console.log(board.move({ x:1, y:1 }, { x:2, y:2 })); // { id: 'king', owner: 'white', kind: 'king' } console.log(board.get(2, 2)); // the same piece, now at its new cell console.log(board.get(1, 1)); // null - the old cell is empty
A generic rectangular grid of pieces - the shared shape underneath a game-specific board (chess, checkers, or a custom game entirely) that only needs cells, bounds checking, and moving a piece from one cell to another.
Example