mwg API
    Preparing search index...

    Function legalMoves

    • Every legal move for the side to play: pseudo-moves that leave their own king safe. Kingside castling sorts before queenside, promotions queen-first - a stable order puzzles and tests can rely on.

      Parameters

      Returns ChessMove[]