[TIL/JS] JSON.stringify() 직렬화 이슈 대응
문제 상황
멀티플레이어 오목 게임에서 ToothlessRule을 구현할 때, 게임 상태를 네트워크로 전송하는 과정에서 장애물 위치 정보가 누락되는 문제가 발생했다.
// ToothlessRule의 initialize 함수
const positions = new Set<string>();
while (positions.size < UNAVAILABLE_COUNT) {
const r = Math.floor(Math.random() * MAX...
studio-pendant.hashnode.dev2 min read