true
, 검정 칸이라면, false
반환환function squareIsWhite(coordinates: string): boolean {
const xDict = {
a: 0,
b: 1,
c: 2,
d: 3,
e: 4,
f: 5,
g: 6,
h: 7
}
const [cx, cy] = [...coordinates]
const x = xDict[cx]
const y = Number(cy)
const isOdd = ((x + y) & 1) === 1
return !isOdd
};