Chalkboard - v3.0.1
    Preparing search index...

    Function truthTable

    • Calculates a truth table for one or more binary boolean operators. The truth table is represented as a 2D array where each row is [p, q, op1(p,q), op2(p,q), ...].

      Parameters

      • ...operations: ((p: boolean | 0 | 1, q: boolean | 0 | 1) => boolean | 0 | 1)[]

        One or more binary boolean operators

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

      const table = Chalkboard.bool.truthTable(Chalkboard.bool.AND, Chalkboard.bool.OR);
      // Returns:
      // [
      // [false, false, false, false],
      // [false, true, false, true],
      // [true, false, false, true],
      // [true, true, true, true]
      // ]