게시판장기로 이해하는 규칙 엔진과 평가 함수 탐색예제 소스

예제 소스

장기로 이해하는 규칙 엔진과 평가 함수 탐색 · 파일 59개

gameTypes.ts

export type MoveRec = {
  ply: number;
  side: "cho" | "han";
  pass: boolean;
  from?: { file: number; rank: number };
  to?: { file: number; rank: number };
};

export type GameRow = {
  code: string;
  guest_id: string;
  access_key: string;
  cho_formation: string;
  han_formation: string;
  mode: string;
  ai_depth: number;
  ai_depth_han: number;
  bikjang: boolean;
  snapshot: string;
  move_no: number;
  epoch: number;
  started: boolean;
  status: "playing" | "ended";
  end_text: string | null;
  moves: MoveRec[];
  created_at: string;
  updated_at: string;
};

export type GameListItem = {
  code: string;
  access_key: string;
  move_no: number;
  started: boolean;
  status: "playing" | "ended";
  end_text: string | null;
  summary: string | null;
  mode: string;
  created_at: string;
  updated_at: string;
};

export type GamePatch = {
  cho_formation: string;
  han_formation: string;
  mode: string;
  ai_depth: number;
  ai_depth_han?: number;
  bikjang: boolean;
  snapshot: string;
  move_no: number;
  epoch: number;
  started: boolean;
  status: "playing" | "ended";
  end_text?: string | null;
  moves: MoveRec[];
};

export type GameAuth = {
  guestId?: string | null;
  accessKey?: string | null;
};