純碁 (Pure Go) Library - v0.2.0
    Preparing search index...

    Type Alias GameState

    ゲームの状態を表す型

    囲碁ゲームの現在の状態を保持します。盤面、手番、コウの位置などの情報を含みます。

    const gameState: GameState = {
    board: [[null, "black"], ["white", null]],
    size: 2,
    currentPlayer: "white",
    koPoint: null,
    moveCount: 2,
    lastMove: { type: "play", position: { x: 1, y: 0 }, color: "black" },
    isOver: false,
    winner: null,
    stoneCount: { black: 1, white: 1 }
    };
    type GameState = {
        board: Cell[][];
        currentPlayer: Color;
        isOver: boolean;
        koPoint: Position | null;
        lastMove: Move & { color: Color } | null;
        moveCount: number;
        size: number;
        stoneCount: { black: number; white: number };
        winner: Color | "draw" | null;
    }
    Index

    Properties

    board: Cell[][]

    盤面の状態を表す2次元配列(Cellの配列)

    currentPlayer: Color

    現在の手番のプレイヤーの色(Color

    isOver: boolean

    ゲームが終了しているかどうか

    koPoint: Position | null

    コウの位置(Position)。コウでない場合はnull

    lastMove: Move & { color: Color } | null

    直前の手(MoveColorの組み合わせ)。ゲーム開始時はnull

    moveCount: number

    手数

    size: number

    盤面のサイズ(9, 13, 19など)

    stoneCount: { black: number; white: number }

    盤面上の黒石と白石の数

    winner: Color | "draw" | null

    勝者の色(Color)、引き分け("draw")、またはnull(ゲーム中)