Alchemization - SafetyFlux/captchalogue GitHub Wiki

There are 7 operation types, which are AND (&&), OR (||), XOR (^^), NAND (~&), NOR (~|), XNOR (~^), and NOT (~~). Since it only applies to one card, NOT is lavender, while the other buttons (which use the other two cards) are cyan. Additionally, AND and OR are canon to the Homestuck universe, while the others exist as concepts. Here's what the program looks like when alchemy and all operations are enabled:

Full Alchemization

So long as an operation is active, changing the holes in the alchemy cards will continue to affect the main card. If you click on the button again, the highlight will be removed and the alchemizing will cease. Next, I'll explain what each operation does, using 1 to represent a punched hole and 0 to represent an unpunched hole.

AND (&&) is like placing two punched cards over an unpunched one, then punching only where both holes in the first two cards are punched. The outcomes for each hole are as follows: 1 && 1 = 1; 1 && 0 = 0; 0 && 0 = 0

OR (||) is like placing one punched card over another punched one, then punching the card wherever a hole exists on the first one. The result is a card that's punched wherever either of the cards has a hole. It goes as follows: 1 || 1 = 1; 1 || 0 = 1; 0 || 0 = 0

XOR (^^) doesn't currently have a reasonable method of performing the operation physically. Essentially, the resulting card has a hole in every location that only one of the two original cards is punched. Simply put, the outcomes are as follows: 1 ^^ 1 = 0; 1 ^^ 0 = 1; 0 ^^ 0 = 0

NAND (~&) is essentially NOT AND, so the product will be the opposite of what you'd get if you use the AND operation. The outcomes are as follows: 1 ~& 1 = 0; 1 ~& 0 = 1; 0 ~& 0 = 1

NOR (~|) is the inverse of OR, so the product will be the opposite of what you'd get if you use the OR operation. The outcomes are as follows: 1 ~| 1 = 0; 1 ~| 0 = 0; 0 ~| 0 = 1

XNOR (~^) is the opposite of XOR, so just like the other two inverse operations, the resulting holes will be the opposite of the standard operation. The outcomes are as follows: 1 ~^ 1 = 1; 1 ~^ 0 = 0; 0 ~^ 0 = 1

NOT (~~) can be performed by placing a punched card over an unpunched one, then punching a hole wherever the first card isn't punched. It essentially reverses the holes, like such: ~~ 1 = 0; ~~ 0 = 1

Here's a much more organized table demonstrating how the logic works:

Alchemy Logic