We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

NANDlang

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

(I can't find any better way to define this other than a stub because I need to prove if it even is Turing Complete or not, and also I am adding more stuff for the code part of this page)

Not to be confused with NAND, nor NANDNZ.

NANDlang is a logic gate-centric and tick-based (not referring to Tick the esolang, the crazy man himself meant tick as in time) esolang that was made by a self-proclaimed crazy man named User:A random guy which fun fact, likes Huggbees and Kasane Teto, but that is completely unrelated so this does not need to be explained further. This programming language was made to compete with COW as one of the worst esolangs to code in out there, mainly due to something you will see later. This esolang might potentially be turing complete as the same man that has been stated here has done a bit of research... though he is still not sure about it. Prove him right or wrong. Also NANDlang does have a similar concept to NAND at first but it is different.

Here is what a NAND gate is for those living in some random rock in Arizona.

NAND Gate Truth Table
Input1 Input2 Output
0 0 1
0 1 1
1 0 1
1 1 0

The Absolutely Brain Discombobulating Basics of NANDlang (Or TABDBN for short because why not?)

NANDlang as the name implies, practically only uses modified NAND gates and a way to toggle on or off ticking. Let's go over everything you need to know about such a topic, which there is plenty:

Command/Instruction Description
NAND(Input1, Input2, 1st Output Connection (Optional);2nd Output Connection (Optional)… nth Output Connection (Optional), Force Print (True/False))_(Order of Printing if there is no Output Connection) This absolute monstrosity of a modified NAND gate that will be explained later.
T set to (True/False) Allows you to set it to either be instantaneous for how booleans transfer from one NAND gate to another, or be in ticks.
Set tick speed to (Number) Makes 1 tick equal (number) milliseconds. Only used if T is set to true.
Connection Type Description
(A-Z)(Number) How you literally format wires.
(Number) How you literally format switches.

Also, # means a comment, just like in Python.

What the diddly darn hell was all of that?! That might put me in Wikipedia's Unusual Deaths of the 21st Century because of the fact that I almost got a brain aneurysm!

You might be asking that if you are Huggbees or a Huggbees fan trying to understand the literal first part of the Commands/Instructions. Which honestly, I get it, the NAND instruction is... quite a mess isn't it?

Let's break that son of a diddly darn Frankenstein abomination down shall we?

Part of NAND instruction Description
Input1, Input2. What in the world do you think when you see that? The literal 2 inputs for a NAND gate that is all it is.
(number)th Output Connection This is used to connect a NAND instruction's output to a input using wires
Force Print When this is true, it forces the NAND instruction to print out it's output, which is false by default if there is Output Connections and you don't need to type in "false" if there is no Output Connections.
_(Order of Printing if there is no Output Connection) This just straight up yells at NANDlang: "HEY YA BLIND MATE, MAKE THIS BE AT THIS PRIORITY WHEN YOU PRINT IT!" which is basically saying to print this at (blank) place. (Basically like 1, 2, 3...) And so NANDlang reluctantly in a absolutely horrified manner, obliges. Except NANDlang doesn't have feelings since it is a esolang so of course it is heartless and doesn't have morals, and the instruction isn't straight up yelling and berating NANDlang.

B-But A random guy! What about the rules?!

First of all, do not give me that tone dude what in the world man? And second, here they are since you want them so bad.

  1. Do NOT leave a wire hanging (open), they will become sad thinking that you abandoned them. (Jk it would just make a error as it wouldn't know where to connect the wire)
  2. Do NOT have multiple wires share the same name, there can only be 2 instances (for input and output) as if there is more than that, NANDlang will get confused on why there is multiple of the same wire and be in the same situation as that Spider-man Pointing meme.
  3. You can have as many instances of the switches as you want, as those instances just mean that "Hey! Switch (number) is connected to this input!" But obviously, they cannot be connected to a output.

And that's it! I hope you didn't have a brain aneurysm midway through which if you metaphorically did, then CAREFULLY (not in HowtoBasic style, you know that) reread all of this again, and if you literally, get to the hospital bro why are you reading this?


Seriously that's it for this section.



What you thought that there was anything else? That's it.

Important lines of code in NANDlang!

Buffer:

T set to False

NAND(1,1,A1)
NAND(A1,A1)

NOT Gate:

T set to False

NAND(1,1)

AND Gate:

T set to False

NAND(1,2,A1)
NAND(A1, A1)

OR Gate:

T set to False

NAND(1,1,A1)
NAND(2,2,B1)
NAND(A1,B1)

XOR Gate:

T set to False

NAND(1,2,A1)
NAND(1,A1,B1)
NAND(2,A1,C1)
NAND(B1,C1)

NOR Gate:

T set to False

NAND(1,1,A1)
NAND(2,2,B1)
NAND(A1,B1,C1)
NAND(C1,C1)

XNOR/XAND Gate:

T set to False

NAND(1,2,A1)
NAND(1,A1,B1)
NAND(2,A1,C1)
NAND(B1, C1, D1)
NAND(D1, D1)

Clock:

T set to True
Set tick speed to (Any number)

NAND(B1,B1,A1,True)
NAND(A1, A1,B1,True)

S-R Latch:

T set to False

NAND(1,1,A1)
NAND(H1,H1,B1)
NAND(A1,B1,C1)
NAND(C1,C1;D1)
NAND(1,1,E1)
NAND(D1,D1,F1)
NAND(E1,F1,G1)
NAND(G1,G1;H1)

D-Latch (With Comments):

T set to False

#NOT:
NAND(1,1, A1)

#AND1
NAND(1,2,B1)
NAND(B1, B1,C1)

#AND2
NAND(A1,2,D1)
NAND(D1,D1,E1)

#NOR1

NAND(C1,C1,F1)
NAND(N1,N1,G1)
NAND(F1,G1,H1)
NAND(H1,H1,I1;J1)

#NOR2

NAND(E1,E1, K1)
NAND(I1,I1,L1)
NAND(K1,L1,M1)
NAND(M1,M1,N1;O1)


D-Latch (Without Comments):

T set to False

NAND(1,1, A1)
NAND(1,2,B1)
NAND(B1, B1,C1)
NAND(A1,2,D1)
NAND(D1,D1,E1)
NAND(C1,C1,F1)
NAND(N1,N1,G1)
NAND(F1,G1,H1)
NAND(H1,H1,I1;J1)
NAND(E1,E1, K1)
NAND(I1,I1,L1)
NAND(K1,L1,M1)
NAND(M1,M1,N1;O1)

D Flip-Flop (With Comments):

T set to True
Set tick speed to (Any number)

#NOT1:
NAND(1,1, A1)

#AND1
NAND(1,U1,B1)
NAND(B1, B1,C1)

#AND2
NAND(A1,U1,D1)
NAND(D1,D1,E1)

#NOR1

NAND(C1,C1,F1)
NAND(N1,N1,G1)
NAND(F1,G1,H1)
NAND(H1,H1,I1)_1

#NOR2

NAND(E1,E1, K1)
NAND(I1,I1,L1)
NAND(K1,L1,M1)
NAND(M1,M1,N1;O1;P1;S1)

#CLOCK
NAND(R1,R1,Q1,True)
NAND(Q1,Q1,R1;J2,True)

#BUFFER
NAND(J2,J2,S1;U1)
NAND(S1,S1,T1;V1)

#NOT2
NAND(P1,P1,W1)

#AND3
NAND(O1,V1,X1)
NAND(X1, X1,Y1)

#AND4
NAND(W1,V1,Z1)
NAND(Z1,Z1,A2)

#NOR3
NAND(Y1,Y1,B2)
NAND(I2,I2,C2)
NAND(B2,C2,D2)
NAND(D2,D2,E2)

#NOR4
NAND(A2,A2, F2)
NAND(E2,E2,G2)
NAND(F2,G2,H2)
NAND(H2,H2,I2)

D Flip-Flop:

T set to True
Set tick speed to (Any number)

NAND(1,1, A1)
NAND(1,U1,B1)
NAND(B1, B1,C1)
NAND(A1,U1,D1)
NAND(D1,D1,E1)
NAND(C1,C1,F1)
NAND(N1,N1,G1)
NAND(F1,G1,H1)
NAND(H1,H1,I1)_1
NAND(E1,E1, K1)
NAND(I1,I1,L1)
NAND(K1,L1,M1)
NAND(M1,M1,N1;O1;P1;S1)
NAND(R1,R1,Q1,True)
NAND(Q1,Q1,R1;S1,True)
NAND(2,2,S1;U1)
NAND(S1,S1,T1;V1)
NAND(P1,P1,W1)
NAND(O1,V1,X1)
NAND(X1, X1,Y1)
NAND(W1,V1,Z1)
NAND(Z1,Z1,A2)
NAND(Y1,Y1,B2)
NAND(I2,I2,C2)
NAND(B2,C2,D2)
NAND(D2,D2,E2)
NAND(A2,A2, F2)
NAND(E2,E2,G2)
NAND(F2,G2,H2)
NAND(H2,H2,I2)