Consensus and any

You will learn

Two gates that only make sense with three values.

CONSENSUS keeps a value both inputs agree on and answers unknown otherwise; ANY takes whichever input is decided and answers unknown only when the two contradict. With two values neither gate has a counterpart, which is part of why a two-input ternary gate has 19683 possible tables. Both are fn bodies of trits.t27, tested on the input pairs that tell them apart.

Open the interactive lesson →