use bit shifts

This commit is contained in:
Satria 2026-07-26 08:35:41 +07:00
commit 125356d321

View file

@ -12,8 +12,8 @@ export enum Piece {
PAWN = 6, PAWN = 6,
// bit 3: color (0-1) // bit 3: color (0-1)
WHITE = 0, WHITE = 0<<3,
BLACK = 8, BLACK = 1<<3,
} }
export const CHAR_TO_PIECE: Record<string, number> = { export const CHAR_TO_PIECE: Record<string, number> = {