T F
Jump to navigation
Jump to search
T F is a language that was made by User:Esolang lover123.
States
States are the building blocks of T F there are only two premade States. they are T and F. [true and false] we can also let states be other "variables" and that will cause their values to be combined! (also strings because hello world) to define States for A you do A= [state1 , state2 , state3... , statefinal ] one of the states we can make is boolean! States A= [T,F]. we also have...
Tasks
tasks look something like this:
Task{variables it uses}{task name}[
{code}
]
you can run a task using Do{task name}with{variables}
Commands
| Symbol(s) | Function |
|---|---|
| *X | get input and store it in X |
| &X | output X |
| <X and X> | X> will go to <X |
| X=Y | if X equals Y then skip the next line |
| X$Y | sets the value in X to the value in Y |
| ! | halts |
Programs
NOT gate
very essential
X=[T,F]
T=[T]
F=[F]
Task{X,T,F}NOT[
*X X=T
X>
Y>
<X &T
<Y &F
]
OR gate
A=[T,F]
B=[T,F]
T=[T]
Task{A,B,T}OR[
*A *B A=T
F>
T>
<F &B !
<T &A
AND gate
Q=[T,F]
A=[T,F]
T=[T]
Task{A,Q,T}AND[
*A *Q A=T
F>
T>
<T &Q !
<F &A !
]
NAND gate
Q=[T,F]
A=[T,F]
T=[T]
F=[F]
Task{A,Q,T}NAND[
*A *Q A=T
F>
T>
<T &Do{NOT}With{Q,T,F} !
<F &Do{NOT}With{A,T,F} !
]
XOR
A1=[T,F]
A2=[T,F]
T=[T]
F=[F]
Task{A1,A2,T,F}XOR[
Do{AND}With{Do{OR}With{A1,A2,T},Do{NAND}With{A1,A2,T,F}
False machine
I=[T,F]
F=[F]
Task{I,F}FalseMachine[
*I I=F
T>
F>
<T &I !
<F &I F>
]
Four-bit successor
A1=[T,F]
A2=[T,F]
A3=[T,F]
A4=[T,F]
F=[F]
T=[T]
A=[A4,A3,A2,A1] <A will be All the A's combined>
Task{A1,A2,A3,A4,F,T}Success[
Do{NOT}With{A1,A2,A3,A4,T,F}=F
T1>
F1>
<F1 Do{NOT}With{A2,T,F}=F
T2>
F2>
<F2 Do{NOT}With{A3,T,F}=F
T3>
F3>
<T3 &A Do{Success}With{A1,A2,A3,A4,F,T}
<F3 Do{NOT}With{A4,T,F} &A Do{Success}With{A1,A2,A3,A4F,T}
<T2 &A Do{Success}With{A1,A2,A3,A4,F,T}
<T1 &A Do{Success}With{A1,A2,A3,A4,F,T}
Output
FFFF FFFT FFTF FFTT FTFF FTFT ... TTFT TTTF TTTT overflow. go back to top
Four-Bit Predecessor
A1=[T,F]
A2=[T,F]
A3=[T,F]
A4=[T,F]
F=[F]
T=[T]
A=[A4,A3,A2,A1] <A will be all the A's combined>
Task{A1,A2,A3,A4,F,T}Pre-Success[
Do{NOT}With{A1,A2,A3,A4,T,F}=T
T1>
F1>
<F1 Do{NOT}With{A2,T,F}=T
T2>
F2>
<F2 Do{NOT}With{A3,T,F}=T
T3>
F3>
<T3 &A Do{Pre-Success}With{A1,A2,A3,A4,F,T}
<F3 Do{NOT}With{A4,T,F} &A Do{Pre-Success}With{A1,A2,A3,A4F,T}
<T2 &A Do{Pre-Success}With{A1,A2,A3,A4,F,T}
<T1 &A Do{Pre-Success}With{A1,A2,A3,A4,F,T}
4-bit adder
A1=[T,F]
A2=[T,F]
A3=[T,F]
A4=[T,F]
B1=[T,F]
B2=[T,F]
B3=[T,F]
B4=[T,F]
A=[A4,A3,A2,A1]
B=[B4,B3,B2,B1]
T=[T]
F=[F]
Task{A1,A2,A3,A4,B1,B2,B3,B4,A,B,T,F}Add[
A1=F
T>
A2=F
T>
A3=F
T>
A4=F
T>
F>
<T Do{Pre-SuccessNoloop}With{A1,A2,A3,A4,T,F} Do{SuccessNoloop}With{B1,B2,B3,B4,T,F}
<F &B !
]