TerraBool

Turn a truth table into a compact Terraria logic-gate module

Find a gate from a truth table

The output column of the truth table, bottom row first: 4, 8 or 16 characters of 0, 1, or x for don't care.

How it works

  1. Type the output column of your truth table, bottom row first.
  2. Press Start: TerraBool lists every cheapest circuit.
  3. Open one to see it tile by tile, then download it as a TEdit schematic and paste it into your world.

Not sure what to type?

ingame example of a module

Several outputs

One truth table per output; they share gates. Paste several lines to add them all.

Advanced

Several outputs, one module

  1. Add one truth table per output. All need the same length and the same don't cares.
  2. Press Start: modules come best first (no diodes, then fewest lamps).
  3. Flip through them, download the TEdit schematic, and check the build details below each picture.

How to use

Why

Terraria wires don't power a device, they toggle it. Two wires joined together act like an XOR gate for free, so a circuit built around XOR needs far fewer gates and lamps than one built from a textbook formula. TerraBool searches for those circuits.

Entering a truth table

Type the output column f of the truth table as one string, bottom row first. 2, 3 or 4 inputs need 4, 8 or 16 characters; the field gets a ✓ at a valid length. Use 0, 1, or x (any lower case letter) for a don't care. The table here is entered as xxx0011011001100.

ABCDf
00000
00010
00101
00111
01000
01010
01101
01111
10000
10011
10101
10110
11000
1101x
1110x
1111x
ingame example of the function

Single: one output

Every cheapest expression is listed; pick one to see its module drawn tile by tile beside the list. They all cost the same, so pick whichever fits your build.

Some functions need two gates whose outputs share a wire. These are listed in two columns: pick one from each, and the module for that pair is drawn beside them.

Reading an expression

⊕ (¬c, ¬ac, ¬cd, acd)

Multi: several outputs sharing gates

Add one truth table per output (pasting several lines adds them all). They must have the same length and the same don't cares. Gates are shared between outputs: an output wired to several gates is their XOR. Advanced → Stop after sets how many wired modules to find; while it runs, the counter shows how many were verified, marked for validation and total checked.

Results come best first: every output on its own wire (no diodes), then one colour per wire, then fewest lamps. Each result shows its lamp and diode badges, the module and a TEdit download; the wire list, the gates with their lamps and the matrix are under Build details.

A result marked Wiring not verified ran out of search time. Try wiring again searches it again with no time limit; Abort stops that.

Reading a module picture

In TEdit, open the Clipboard tab on the right, press Load and pick the downloaded .TEditSch file. Then click in your world to paste it.

TEdit's Clipboard tab with its Load button