Chalkboard - v3.0.1
    Preparing search index...

    Function Karnaugh

    • Calculates a Karnaugh map (K-map) for a boolean expression. It supports 2, 3, or 4 variables and returns a 2D array representing the K-map with cells as 0 or 1.

      Parameters

      • input: string

        The boolean expression to map

      • variables: string[]

        An array of variable names (order matters)

      Returns (boolean | 0 | 1)[][]

      // For a 3-variable expression
      const kmap = Chalkboard.bool.Karnaugh("x & !y | z", ["x", "y", "z"]);