2.2.3 • Published 4 years ago

@hckrnews/truth-table v2.2.3

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
4 years ago

Truth Table package

Generate a truth table very easy. The generated truth tables can be used for e.a. test cases, if you would test a lot of situations.

NPM version Build Status Coveralls Status Scrutinizer Code Quality

Installation

npm install @hckrnews/truth-table or yarn add @hckrnews/truth-table

Test the package

npm run test or yarn test

Usage

Example usage:

import AndTruthTable from "@hckrnews/truth-table";

const table = AndTruthTable.create(3);

Table inputs result:

table.inputs

Output:

[
    [false, false, false],
    [false, false, true],
    [false, true, false],
    [false, true, true],
    [true, false, false],
    [true, false, true],
    [true, true, false],
    [true, true, true],
]

To receive results of the and operator:

table.output

Output:

[false, false, false, false, false, false, false, true]

Do you with te receive the result with the inputs of the and operator:

table.result

Output:

[
    [false, false, false, false],
    [false, false, false, true],
    [false, false, true, false],
    [false, false, true, true],
    [false, true, false, false],
    [false, true, false, true],
    [false, true, true, false],
    [true, true, true, true],
]

All options:

  • AndTruthTable
  • NandTruthTable
  • OrTruthTable
  • NorTruthTable
  • XoTruthTable
  • XnoTruthTable
  • XandTruthTable
  • XnandTruthTable
  • NotTruthTable

To check all used logic gates: https://www.npmjs.com/package/@hckrnews/logic-gates

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago