Skip to main content
121 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Dominoes, 122,000 bytes or 72 tiles The byte count is the size of the saved file which is 0.122 MB. Domino computing was the inspiration. I have tested all of ...
NonlinearFruit's user avatar
49 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Hexagony, 89 bytes Thanks to FryAmTheEggman for some necessary inspiration for the XOR solution. ...
Martin Ender's user avatar
43 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

APL, 22 20 18 bytes The true and false entries are complete programs, and the other 14 are functions. (Thanks to Adám.) ...
jimmy23013's user avatar
33 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Chess/mediocre chess player in endgame, 70 pieces Inspired by that domino answer, I decided another game should have this honor. Note that I took a few rules for how the pieces move. Because I don't ...
Destructible Lemon's user avatar
31 votes

Logic Gates Manually

Python 2, 38 bytes lambda s:sum(map(ord,s))*3%61%37%9%7%2 Try it online! A good ol' modulo chain applied to the sum of ASCII values of the input string, making ...
xnor's user avatar
  • 145k
29 votes

Evaluating Logic Gates

Python 3, 53 50 49 bytes Thanks @JonathanAllan for saving 1 byte! lambda a,b:"NOR N"[a|b:5-a*b]+"AND X"+"NOR"[a^b:] Try it online!
Surculose Sputum's user avatar
27 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Jelly, 19 bytes ...
Dennis's user avatar
  • 210k
26 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Bitwise Cyclic Tag, 118 bits = 14.75 bytes Bitwise Cyclic Tag is perhaps the simplest Turing-complete language ever devised. There is a program tape and a data tape, both consisting of a list of bits....
Anders Kaseorg's user avatar
26 votes

Church Booleans

Haskell, 50 - 6 = 44 bytes -1 byte thanks to Khuldraeseth na'Barya, and -1 byte thanks to Christian Sievers. ...
Nitrodon's user avatar
  • 10.8k
25 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

NAND logic gates — 31 gates As the creator of the original series of NAND gate questions, I couldn't pass up the opportunity to use these gates to solve another logic gate problem. In each of these ...
Joe Z.'s user avatar
  • 35k
24 votes

Counting universal n-ary logic gates

Python 3.8 (pre-release), 287 282 242 bytes -5 bytes thanks to @Dialfrost ...
AnttiP's user avatar
  • 7,898
23 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Python 2, 137 bytes ...
xnor's user avatar
  • 145k
23 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Go (game), 33 stones, 73 intersections If domino and chess are acceptable, then this. It can't be too golfy on a full 19x19 Go board. So I used small rectangular boards. The input is whether the ...
jimmy23013's user avatar
22 votes

Drive a hexadecimal 7-segment display using NAND logic gates

30 NANDs I am quite sure there are no simpler solutions to this problem, except perhaps by changing the symbols on the display, but that would be another and different problem. Since this is actually ...
KimOyhus's user avatar
  • 711
16 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Javascript ES6, 124 bytes ...
Mama Fun Roll's user avatar
15 votes
Accepted

Build a multiplying machine using NAND logic gates

39 gates I am quite sure there are no simpler designs than mine here. It was very difficult to make. I make other minimal circuits too. Transmission delay is indicated by downward position of each ...
KimOyhus's user avatar
  • 711
15 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Retina, 62 39 bytes 23 bytes thanks to @MartinEnder! ...
Leaky Nun's user avatar
  • 49.8k
15 votes

Run Stackylogic

Retina, 79 78 73 68 66 65 63 62 55 44 bytes Byte count assumes ISO 8859-1 encoding. +`(.)([^_]*)\?<|(¶.*)0<|1<(¶.+) $2$1$4<$3 1< Input is via ...
Martin Ender's user avatar
15 votes

Implement the Conjunction of a Three-Valued Logic

Python, 22 bytes lambda s:s["T"<s<"UT"] Try it online!
Anders Kaseorg's user avatar
14 votes
Accepted

Church Booleans

Binary Lambda Calculus, 13.875 12.875 bytes (103 bits) Binary Lambda Calculus Language (BLC) by John Tromp is basically an efficient serialization format for lambda calculus. It is a great fit for ...
Pavel Potoček's user avatar
13 votes

Run Stackylogic

Convex, 102 95 bytes Well, a list-of-stacks-based language coded in a stack-based language turned out to be quite difficult. Mark my words: I will get this to 100 bytes or less! EDIT: Success! ...
GamrCorps's user avatar
  • 7,592
12 votes

Implement a very simple ALU using only NAND gates

71 64 49 gates First define a few additional boolean operations in terms of NAND: ...
ovs's user avatar
  • 59.5k
11 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Stack Cats, 67 + 64 = 131 bytes Note that the +64 is from applying the -nm flags to each program. -n indicates numeric I/O, and ...
Sp3000's user avatar
  • 61.9k
10 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Minecraft, 89 blocks In all of the following photos, blue blocks are for Input A and orange blocks are for Input B 16. TRUE gate - 1 blocks 15. NAND gate - 1x2x3 = 6 blocks 14. A=>B - 1x2x3 = 6 ...
Husnain Raza's user avatar
10 votes

Logic Gates Manually

JavaScript (ES6), 39 bytes s=>341139>>parseInt(btoa(s),34)%86%23&1 Try it online! How? We can't parse spaces with ...
Arnauld's user avatar
  • 193k
10 votes

Church Booleans

Python 2, (-3?)  101  95 bytes David Beazley eat your heart out! -6 thanks to Chas Brown (moved the repeated : into the join text >.<) ...
Jonathan Allan's user avatar
10 votes

What logic gates work given the input?

JavaScript (ES6),  58  56 bytes n=>`25AND 41OR X37OR`.replace(/\d+/g,m=>m>>n%6&1?'':'N') Try it online! How? Given the input \$n\$, we compute \$n\...
Arnauld's user avatar
  • 193k
10 votes

Build the stove controller (physically)

CircuitVerse, 455 NANDs 1x NOT (1 NANDs) 2x AND (4 NANDs) 3x OR (9 NANDs) 1x 4-bit 2x4 multiplexer (96 NANDs) 1x 4x1 Decoder (6 NANDs) 1x 4-bit adder (108 NANDs) 1x 2-bit Memory (54 NANDS) 1x 4-bit ...
Logan MacDougall's user avatar
9 votes

Build a 4-vertex Connectedness Tester using NAND gates

19 NANDs There is no simpler circuit than this. There is code for testing it below the picture. As for understanding it, that's difficult. There are a couple of IF gates there, and the inputs are ...
KimOyhus's user avatar
  • 711
9 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Haskell, 78 76 75 bytes _#_=2<1 && > pure ...
nimi's user avatar
  • 35.9k

Only top scored, non community-wiki answers of a minimum length are eligible