mwg API
    Preparing search index...

    Function playGo

    • Places a stone, captures any enemy group left with no liberties, and enforces ko (a move that would recreate the position before the opponent's last capture is refused).

      Parameters

      • state: GoState
      • x: number
      • y: number

      Returns void

      import { startingGo, playGo } from '@datamoc/mw_games/board';

      const state = startingGo(9);
      playGo(state, 4, 4);
      console.log(state.turn); // 'white' - the turn passes after a legal move