Truth-machine
- Not to be confused with Truth Machine (language), nor Turth-machine.
A truth-machine is a simple program type, devised by User:Keymaker to be a program that is easy, most of the time, to implement in a language, and useful for testing or showcasing the following capabilities of a language:
- input
- output
- decision
- repetition
- termination
Essentially, a truth-machine works like this:
- Ask for input.
- If the input is 0:
- Output 0.
- Terminate program.
- Whereas if the input is 1:
- Repeat infinitely:
- Output 1.
- Repeat infinitely:
In languages without input capabilities, a truth-machine might instead have a simple way for the user to modify a variable or other structure in the beginning of the program, and the machine would do its decision based on that. A truth-machine in a language without output capabilities might simply either terminate or not terminate, based on the the input. The essence of a truth-machine is that some part of it, whether in the memory the program is using or in the program's code, may be either A or B, and the program contains the capacity (namely, program code) to do either of two possible things: in case of A the machine/program will perform an infinite loop, in case of B it will quit running. An alternative to output could be placing a 0 in memory once, or start filling the (infinite) memory with 1s.
Implementations
!!Fuck
!!!!!#!!!!!#!!!!!#!!!!!!!!!#!!!!!!!!!!#!!!!!!!!!!!#!!!!!!!!!!!#!!!!!!!!# !!!!!#!!!!!!!#!!!!!!#!!!!!!#!!!!!!!#!!!!!#!!!!!!!!!!!!#!!!!!#!!!!!!!!# !!!!!!!!!!!!#!!!!!!#!!!!!!#!!!!!!#!!!!!!!!!!!#!!!!!!#!!!!!!#!!!!!!!!!!!!# !!!!!#!!!!!!!!!!!#!!!!!!!!!!#!!!!!!!!!!!!#
!@#$%^&*()_+
0_*(!#)#
$+-?
$++++++F?p$--------$-fP$?z-?nhN$++++++Q?o$++++++++$-qO$+ -$oZ$++++++R?a$++++++++$-rA$ $H
#b
VAzVDsfjrdNPhxlZfjFvVhlZWZvqIDWAAsAOgMWwqOokmugIwoIYGaZheWYivOWkAnqppnxudlnjF BPHppjXXrzxJVYNtqKFZBBDVzlDDbFrZPfJrlFdZfbzJvOGkahwESOlGzFSVaJkGzAixnXdbHbNtjhlvbVR vVwTPAszXTnBBblXBrpNvbdJhzhrtLjPzjwcuqdgkocJeJq
(...) IS 2D!!
$ _________ ([=] [ ≠ ]) [‗]❲{⊗|‗}❳ [⎻] &
(top, height)
~ 2: ..\
-C++
#define int long long #define _ struct print1{int operator!(){while(1)cout<<1;return 0;}};signed main(){int x;print1 p;cin>>x;return ((!x)?(cout<<x,0):!p);} _
/gɹəʊguː/
;<{!<![}&1+,<!]?
?Q?
#,$.*
note that for 0, ) must be inputted
@
?ň¤Ō10
{}s
# 2<1 0<2 [2, {0<2}]
05AB1E
[?_#
0815
|~}:i:%^:i:
0 bytes XD
<input goes here>
Replace <input goes here>
with the input.
100BF
1OO 1OO 1OO l00 l0O lO0 lO0 10O 1OO 100 1O0 1O0 100 1OO lOO 1OO 10O lOO 1O0 1O0 1O0 lO0 1O0 1O0 lOO 1OO lO0 l0O lOO
15
@_...{#!}
2-ill
@ @ @@ @ @ # # # @@ $ @ @ @ @ @ @
2DFuck
,x>,x>,x>,x>,x>,x>,x>,x<<<<<<<r.>r.>r.>r.>r.>r.>r.>r.[<<<<<<<r.>r.>r.>r.>r.>r.>r.>r.]
2dL
iι----.-&- f(x) _ }λ-.-πu _ x x }λ-.----π_u{ x f(x) }(¯
2ds
'0x xb .x xa != while '1x x. elihw bx x.
2KWLang
=main.2kwl! import 0; import "\0.2kwl"; =1.2kwl print "1"; import "1.2kwl"; =0.2kwl print "0";
3 Bits, 3 Bytes
Kpx
x is the input: @
for zero, and A
for one, outputs @
once and A
infinitely for each input respectively.
33
O[on@]
3x
?([1])[0]
4
3.70050060148102000180250094
4 bits, 8 bytes
This esolang has no input, so instead the ? is replaced with the input.
√m√×F○○?
4BOD
6 bits, 12 bytes
Normal: §□ρ?ΨαFυÒ□□□ Unshackled: ↓c*0 →Cc. 1(→) **** Bytes: 8f 00 10 3f 1c 01 46 13 d2 00 00 00
8ial
PUT $1 JIR o $1 1 PSH $1 OUT JIR e $1 0 ;o PSH $1 OUT JIR o $1 1 ;e
8xn
8x5=[6=]
5=
gets input and checks if it equals 0 and if so skip the "["
[6=]
Since it still equals 0, output, then skip the close bracket and halt the program
=?
「₪」《input》 《one》|‿《〈⟨1⟩〉》⁀| 《output》⬠⬡ input <1=?> one input <1=?> output
><>
i'0'-:?vn; : >^
Also works for *><>.
^!
,:^!!!!:+:+::++-[:.^!].
ثلاثي
ﻮﻛﻮﻃﺎﺑ ﻲﻛﻮﻃﺎﺑ ﻲﺼﻃ ﺎﻛﺎﻄﺑ ﻁﺎﺳﺎﻃ ﺎﺴﻤﺣ ﺪﺒﺟ ﻲﺴﻤﺣ ﺎﻃﻮﺳﺎﻃ ﺲﻤﺣ ﻮﻜﻴﻄﺑ
תלת
וכוטאב יכוטאב יצט אכאטב טאסאט אסמח דבג יסמח אטוסאט סמח וכיטב
™
Most dialects in this esolang are made to implement the Truth Machine easily.
Type 1 and Type 2 and Type 6 and Type 7 and Type 9 and Type 10
™
Type 3 and Type 5 and Type 8
The Truth Machine for type 3 and type 5 and type 8 are shorter than Truth Machine in any other language.
Type 4 and Type 11
It is impossible to write a Truth Machine in these dialects.
硕鼠
吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱吱吱吱 吱吱吱吱吱 吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱 吱 吱吱吱吱吱 吱吱吱吱 吱吱吱吱吱吱 吱吱吱吱吱吱 吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱吱 吱 吱吱吱吱
⊗
Start of road Path x Signal>Interger Give way x is 0 Parking Area '0' End of road Else switch Parking Area '1' No stopping 6
ACL
1A54B64BF78
A:;
j:1;i:l;?:l:=:j:2;p:j;g:3
Aardvark
Pass void() or yield() to truthMachine() for 0 or 1 respectively (there's no input in Aardvark).
async zero() { print "0" } async ones() { print "1" await ones() } async then(task, result) { await task return result } async truthMachine(input) { await await poll(then(input, zero()), ones()) }
Acrostic
N CONTINGENCIES T C H N A I R O N COMMENCE NOTHINGNESS G A H E DUPLICATED N G
Acyclic Tag
.48 .49^ +^
Set the input bit by changing the last line; "^" for 0, "+^" for 1.
Aeolbonn
The first line is the input. Printed with newline after each 1:
0 1 8 1 :1 : 4 1 :0
Without newline after each 1:
0 1 6 1 :1 4 1 :0
AF
31 00 00 03 01 20 00 32 00 22 10 00 03 01 30 00 11 21 32 00 30 00 03 00 30 00 31 01
AGSPL
~$.{1=}{1.}#
Aheui
뱡먕뺘뼈처망희
Airline food
You ever notice this thing? What's the deal with this? It's kinda like this. Just like this. Just like this. What's the deal with it? It's kinda like it. Just like this. It's kinda like this. It's kinda like this thing. What's the deal with airline food? Right? Just like it. So... See? Moving on... It's kinda like it. Not like this thing. See?
A Language Programmed While Listening to Godspeed You! Black Emperor
charms 48﹔ read﹔ difference﹔ loop﹔ charms 48﹔ sum﹔ dup﹔print﹔ charms 48﹔ swap﹔ difference﹔ end﹔ charms 48﹔ sum﹔ print﹔ give up﹔
Alight
begin;var i;inp i;skip i;turn right;;out 1;turn right; ot t uh u tg r i n 0r ; r en i nr g du h ;t t ;thgir nrut;;;;;;;
ALLSCII
With string input:
>'%%""C 92!?F 42?
With number input:
LC 44!?F44?
Alpha
~Remove the alpha for 0~ +α[$]
Alphabet Stew
rtsetviiv
ALPL
For the sake of simplicity, this program operates on bits instead of chars.
``?``=l[x.``1xx]l`00
AmBored
If the input is 0, it writes "0" in white once on the screen. If the input is 1, it writes "1" in alternating colors.
>>7v7v7v7v7<,[0>[++^++^++^++^++.vvvv]]7<7^7^7^7^7>7.
AmogusScript
gus vote "Enter 0 or 1: " if gus is 0: 0 if gus is 1: 1 for eternity
Among Us
YELLOW SUS GREEN SUS BROWN SUS PURPLE SUS WHITE SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS SUS BLUE SUS WHO? ORANGE SUS SUS SUS SUS RED SUS SUS SUS SUS SUS SUS SUS SUS BLUE SUS PINK SUS BLUE SUS WHERE? PURPLE SUS WHO? GREEN SUS WHERE?
Andromeda
Treats the queue as an input/output mechanism.
vv< >?v >^
Aubergine
=Ao=bi=oA=aA-ai-ai-ai-ab-a1:Ba=ib
Argh!
lglj j jShh lrllxpq 0jph0 j1k llk
Arrow
>>#v#v#<![¤>[¤^¤^¤#v#v#]#<#^#^#>#
Replace !
with #
for input = 1 and nothing for input = 0
A.R.T.I.C.L.E.
get_input f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13. push push push push push. push push push push push. zero_label. dec f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12. n n n n n. n n n n n n1. loop_until_0 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18. f f f f zero_label. add_0_to_compare f2 f3 f4 f5 f6 f7 f8 f9 f10 f11. n n n n n n1 n2 n3. n n n n n. pop_and_cmp f2 f3 f4 f5 f6 f7 f8. bnoc_0 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17. f f f f print_0. zero_label2. dec f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12. n n n n n. n n n n n n1. loop_until_0 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18. f f f f zero_label2. add_1_to_compare f2 f3 f4 f5 f6 f7 f8 f9 f10 f11. n n n n n n1 n2 n3. n n n n n n1. pop_and_cmp f2 f3 f4 f5 f6 f7 f8. bnoc_1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17. f f f f print_1. end_if_none f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15. f f f f end. print_1. print1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14. loop f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16. f f f f print_1. print_0. zero_label3. dec f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12. n n n n n. n n n n n n1. loop_until_0 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18. f f f f zero_label3. add_0_to_print f2 f3 f4 f5 f6 f7 f8 f9 f10 f11. n n n n n n1 n2 n3. n n n n n. print0 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14. get_input f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13. end.
AsciiDots
/(#1$_#) .----~#0$#& .-#?-^
asm2bf
It's using inline brainfuck to keep things relatively concise.
in_ r1 jz_ r1, %skip raw .> raw .> raw .[ raw .. raw .] @skip out r1
When assembled:
+>+[<[>>+>+<<<-]>>[<<+>>-]>[[-]>>,>>>>+<<<<<<+>>[<<[-]<+>>>-]<<<[>>>+<<<-]>[<<<[-]>[-] >>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]<<<[>>+>+<< <-]>>[<<+>>-]>[[-]>>[.]]>+<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<-> [-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>.<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[- ]<<<[-]>[-]>>]<<]
Assembly language
This is not the actual program; this is the program in mnemonics.
MOV 01 00 MOV 00 01 JZ 0E 01 MOV 00 01 JMP 09
Astridec
72222222222222222222222222222222222222222222222226 501111111111111111111111111111111111111111111111111805 601111111111111111111111111111111111111111111111118 *prints '0' if input is '0', prints '1' forever otherwise. Newlines not required*
AutomataFuck
`}<<< :�[$_].
Replace }<<< :�
with null (U+0000 / �) and omit $
from [$_]
if possible. (file)
Babalang
The program return code is 1 if input is neither 0 nor 1
0_str is you and move and more and move and more and more and more and more 1_str is 0_str and move baba is you and word ice is tele baba on 0_str is text baba on 0_str fear ice baba not on 1_str is defeat baba is text ice is done baba is win
Batch
@echo off set /p truth=Your input? if %truth% EQU 1 goto loop echo 0 pause>nul exit :loop echo 1 goto loop
Bawkbawk²
Assumes 0 is 0 and anything >= 1 is 1.
§<c«<cΠ§¼↑√c
Beam
rS v >@<) @
Bedtime
Charlie's! What could've ended? Forgives, a forget. Love spiritual O! A teacher. Bowser, four ghosties E.
Beeswax
{p'<T_ >{d
Befunge-93
&#::_.@#
Another variant, shorter but leaks stack:
&>:.:_@
Befunk
This is a LifeViewer code. Please compile it into Hexdump or a picture if possible.
Click here for a LifeViewer display
[code]x = 0, y = 0, rule = LifeColorful SJDbV$bAODFOX! [[ COLOR 0 255 255 255 ]] [[ COLOR 1 0 255 51 ]] [[ COLOR 4 51 187 255 ]] [[ COLOR 6 0 255 34 ]] [[ COLOR 10 0 255 50 ]] [[ COLOR 15 51 170 51 ]] [[ COLOR 19 51 170 102 ]] [[ COLOR 22 0 255 102 ]] [[ COLOR 24 119 119 119 ]][/code]
Note: The color of each letter is declared at the bottom of the program. Translated from Befunge code below:
&>: v ^.:_.@
Benul
00 00 00 07 00 00 00 00 07 07 07 07 00 07 07 00 07 07 00 07 07 00 07 07 00 07 07 00 07 07 00 07 07 00 07 07 00 00 07 00 00 00 07 00 00 00 00 07 00 00 00 00 00 07 07 07 00 07 07 07 00 00 00 07 07 07 00 07 07 07 00 00 00 07 07 07 00 07 07 07 00 07 07 07 00 00 07 07 07 00 00 00 00 07 00 00 07 00 00 00
beta-Juliet
beta-Juliet does not have conventional I/O, but can model input and output as events.
event AZeroIsOutput; event AOneIsOutput; event AZeroIsInput, causes AZeroIsOutput; event AOneIsInput, causes AOneIsOutput, causes AOneIsInput.
Betterave
?-1:[.1|1]!.0
Betul Betul BetulLang
Tak | A truth-machine program Betul Betul Betul Betul Betul Betul: Betul. Betul Betul Betul Betul Betul Betul Betul: Betul, . Betul Betul Betul Betul Betul Betul: Tak Betul. Tak | Recieving input Betul Betul Betul Betul! Tak | Jumps to line 19 Betul Betul: Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul, . Tak | the 1 part Betul Betul Betul Betul Betul Betul: Betul. Betul Betul Betul Betul Betul Betul Betul Betul! Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul! Betul Betul Betul Betul Betul Betul Betul Betul Betul! Betul Betul Betul! Tak | Jumps to line 11 Betul: Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul. Tak | the 0 part Betul Betul Betul Betul Betul Betul Betul Betul! Betul Betul Betul!
Binary lambda calculus
010001101000000110000000010110111001011110000010010111111011111011110
BinaryLanguage
+++~++++~<~,^(^(.))^.
Bird
> =?=&1v>'0'/~ ]1t/'1'[<
BIT
LINE NUMBER ZERO CODE READ GOTO ONE LINE NUMBER ONE CODE GOTO ONE ZERO IF THE JUMP REGISTER IS ZERO GOTO ONE ONE IF THE JUMP REGISTER IS ONE LINE NUMBER ONE ZERO CODE PRINT ZERO LINE NUMBER ONE ONE CODE PRINT ONE GOTO ONE ONE
bitch
\>/;<
BitChanger
<<<<< <<<<< <<}<} }}}}} }}}}} <<<<< <<< }}}}} }}} [ <<<<< <<<<< <}<} }}}}} }}}}} <<<<< <<<<< }}}}} }}}}} ] <<<<< <<<<< <}
Bitoven
a?[aa-b+c+]d++++++[dd-b--------]c![bc!]
BiTrax
Enlarged view
Actual size
Bit Stupid
3-byte version.
,:.
Bitter
m0 = 0 >><
m0 = 1 ><(>><)
Bitwise Cyclic Tag
11
Bitwise Trance
01011000001011000001110000001111000000010101111
Black
In the code below, input is calibrated for 1.
input:O1 truth-machine in Black. calibrate machine by moving * under O or 1. * needs to use output extension. uses O instead of 0 because the Javascript interpreter makes 0s vanish for some reason. * * * * * * * * * O * 1 * *
Bleh
^: std::io; // Get next char from input and pass it to choice. main := choice io::next(); // If input is exactly UTF-8 zero, call print0, otherwise call spin. choice : "0" = print0() : .. = spin() ; // ^, the .. pattern here matches everything, including any number of arguments. // Just print 0 and return print0 := io::debug 0; // Infinite loop of printing 1 spin := { io::debug 1; spin() // Tail-recursion should be optimized so this doesn't overflow call stack };
Blood32
<This truth machine sets the leftmost cell randomly to 1 or 0. If 0, print a 0. If 1, print 1 endlessly> <a one cell grid> [1,1] <tape is empty> T: { <set leftmost cell to a random value 0 or 1> D() < start of a conditional statement > Z(0) Y(1) <do zero case> L(0) R(0) B() E() <do one case> L(1) R(0) B() <loop> G(1) }
Blindfolded Arithmetic
a = i / i b = a + a c = b + b c = c + a c = b * c i = c * i i = a + i
Input of 1 sets i to an infinite string of 1
s but doesn't print
boolfuck
,>,>,>,>,>,>,>,<<<<<<< [;>;>;>;>;>;>;>;<<<<<<<] ;>;>;>;>;>;>;>;
borth
S: var i !input! label if 0 i z label > 0 o i label.make z 0 print E: label.make o 1 print label o
Brace For Impact
(t@)in(j^)(y~) (q#)in = 0(j^) (f=) (e%) (t@)out(j^)1 (w&)out = 1(j^) (s;)out (f=)
BracketOnly
(()()()()()()()()()()()()()()()()()()()()()()()()()()()())((()())()(()()()()()()()()()()()())())(()()()()()()()()()()()()()()()())((()()()()()()()()()()()()()()()()()()()()()()()()()())((()())()))(()()()()()()()()()()()()()()()()()()()()()()()())((()()()()()()()()()()()()()()()()()()()()()()()()()())((()())())(()()()()()()()()()()()()()()()())(()()))
Brainbits
>>\>\>>>>,\/\<<<<<<<.>>>>>>>\/
Brainf*ck
>[,]<.>[-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<[>[-++++++++++++++++++++++++++++++++++++++++++++++++]<.>[-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<]
brainfuck
>>>,.[[->+<<+>]>-]<<<[<<]>[.]
I have a shorter one that needs negative cells:
,.[[-<+>>+<]>-]<<<[<<]>[.]
Another one based on subtraction(That is the simplest I can go)
,.[->+>+<<]++++++[->--------<]>[>[.]]
In versions where integer overflow wraps around, this 18 bytes machine is possible:
,.[-->+[>>]<[.]<<]
The first cell holds the input and the second cell will count up to P, the period of the overflow, where it will wrap back to zero. Given 0, subtracting 2 will cause the loop to cease. Given 1, it will loop P times, then ([>>]) is skipped, which causes (<[.]) to point at the first cell. After looping P times, 2P must be subtracted form the input n, but as P is the period, this means n - 2P mod P = n, thus 1 is printed forever.
There is also a 17 bytes version that needs negative cells:
,.[-->>+[<]<]<[.]
Brainfuck extended
_30~,~-~?_31[.]:_30.'
It is easy to write a truth machine in this language, because it has conditional operators.
This truth machine will treat characters that are not 0 as 1.
Brainfuck+10
/[#]#
Brainfuck+2
;[:]:
brainfuck--
.>>>>>>>.[.]
brainfunct
////////////////////////////////////////////////.@/,.@
Braingrate
Version without accounting for values higher than one
,[:]
Version with accounting for values higher than one
,=<-*>[-]<^*>[:]
Brainlisp
(in)(out)(loop(loop(dec)(left)(inc)(right)(right)(inc)(left))(right)(dec))(left)(left)(left)(loop(left)(left))(right)(loop(out))
Brainloller
Short, but needs negative cells.
BRASCA
[1n]n
Broccoli
{ 0 output } { { 1 output } { true } while } input number == 0 if
Broken Calculator
As with all programs in this language, this has a random chance of crashing.
INP @0 CBEQ 0 @0 0 LBL 1 PIN 1 GOTO 1 LBL 0 PIN 0
Bruijndejx
Using 8-bit ASCII:
dis=[*0 0?]; no=*/./././.\.\././; yes=yes\./././.\.\././; main=*yes no?dis.dis.dis.dis.dis.dis.dis;
Bueue
x009
(x being either 1 or 0).
Buffalo!
Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo buffalo buffalo. Buffalo buffalo Buffalo buffalo buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo buffalo. Buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo buffalo buffalo. Buffalo buffalo Buffalo buffalo buffalo! Buffalo! Buffalo Buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo buffalo. Buffalo buffalo Buffalo buffalo buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo! Buffalo Buffalo buffalo buffalo buffalo. Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo Buffalo buffalo buffalo! Buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo. Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo. Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo. Buffalo! Buffalo Buffalo buffalo Buffalo buffalo buffalo! Buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo! Buffalo! Buffalo Buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo! Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo! Buffalo! Buffalo Buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo. Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo! Buffalo Buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo. Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo Buffalo buffalo buffalo! Buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo buffalo. Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo Buffalo buffalo buffalo buffalo buffalo buffalo. Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo! Buffalo buffalo Buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Buffalo buffalo buffalo Buffalo buffalo. Buffalo Buffalo buffalo! Buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo! Buffalo Buffalo buffalo buffalo buffalo.
Input lower than "0" is interpreted as 0; input higher than "1" is interpreted as 1.
BunnyBell
func main input &0 0 beq &0 0 Terminate label Forever out 1 goto Forever label Terminate out 0 return
Bur
Bur doesn't have any form of input. Instead, change the character at index 24 to be 0 or 1:
~@0#0!!;~@1#1!!v@1@;~@,#0!~$0?#0!~$0!‽=0*#1!~$0!‽=1*;
A shorter example that tests 1 vs "anything else" rather than 1 vs 0. This time, the index in question is index 16:
~@1#1!!v@1@;~@,#0!#1!‽=1*#0!!v;
Burlesque
ri{^^}w!
If STDIN is not on the stack replace ri with either 0 or 1.
ByteByteJump
00000000 ff 06 03 06 ff 06 00 08 00 00 00 00 00 00 00 00 |................| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000030 ff 03 |..| 00000032
Note that ByteByteJump, as more of a class of CPUs than a system, needs to be further described for a program. In particular, the version used here has 1-byte addresses. However, this program can be extended up to 5-byte addresses relatively trivially.
As for IO, 0xFF is assumed to be both an input and output port (having it pre-initialized and no output works just as well). Termination is handled via jumping to 0xFF, which implies 2 bytes of the instruction are out-of-range - the handling of this appears to be system-defined anyway (BytePusher handles this via zero-padding).
Finally, entering a character which is not '0' or '1' as the first character of input will fail horribly.
C
#include <stdio.h> int main(a){ scanf("%i",&a); if(a==1){ while(1){ puts("1"); } } else{ puts("0"); return 0; } }
C++
Note: Extracted using Claude 3.5 Sonnet from File:Ternlsb_tm.png
#include<iostream> using namespace std; int main() { int a; cin>>a; if(a==0) { cout<<"0"<<endl; } if(a==1) { while(1) cout<<"1"<<endl; } return 0; }
C#
internal class Program { private static void Main(string[] args) { int a = Convert.ToInt16(Console.ReadLine()); if (a == 0) { Console.WriteLine(a); } else { while (a == 1) { Console.WriteLine(a); } } } }
Caca
youcaca newcaca zecaca? cacato12 nocaca? cacato12 yescaca cacaca49 icacac icaca cacato10 yescaca cacaca48 icacac icaca
Basically, it uses youcaca to ask for user input (Caca can only handle numbers as input), then, if the number is a 0 or a negative, it goes to the end using a cacato statement, which then outputs one 0 then stops, but if its positive, it then goes on to printing 1, then goes back and prints 1 using a cacato statement
Carriage
111-@1\11-~!$$11+1+1+1+\1+1+1+1+1+1+@11-~!$$1-
An explanation is available.
CellArg
+ 5 1+ 5 1+ 5 5+ 5 1+ 5 5+ 0 5- 5 5+ 5 1+ 5 1+ 5 1+ 5 1+ 5 1+ 5 1+ 0 5+ 6 1- 5 5+ 5 10- 5 1- 5 1+ 0 5+ 8 1$ 5+ 6 5- 5 10- 5 10- 5 10- 5 10- 5 1- 5 1- 5 1- 5 1- 5 1- 5 1- 5 1- 5 1+ 8 10+ 8 10+ 8 10+ 8 10- 8 1# 6; 8 5
Cerberus
.-...-..--.--....-..-.-- .-.---..-.--.----..-..-- --.-..-.--.-.....-.-..--
Cfluviurrh
a< b=8 b*=6 z@=N z?a=b :Y a> z@=Y z?1=1 :N a>
In addition to fulfilling the tasks of a truth-machine, this program will experience mild satisfaction if the input is '0', and if the input is '1', it will feel extreme happiness (once) followed by mild distrust (an infinite number of times.)
Churro
{========={o}{o}}{====={o}{======{o}{==={o}{====={o}{====={o}{========{o}{===={o}{========{o}{=========={o}
C-INTERCAL
This program probably also works in CLC-INTERCAL.
DO WRITE IN .1 DO COME FROM .1 (1) DO READ OUT .1 PLEASE GIVE UP
An alternate truth machine that actually takes "0" and "1" and prints "0" and "1" as opposed to taking "ZERO" and "ONE" and printing "_" and "I" is (By User:Oshaboy)
DO ,1 <- #1 DO WRITE IN ,1 PLEASE ABSTAIN "',1 SUB #1'~#1" FROM NEXTING PLEASE (12) NEXT DO ,2 <- #1 DO ,2 SUB #1 <- #116 DO READ OUT ,2 DO ,2 SUB #1 <- #0 DO COME FROM (20) (20) DO READ OUT ,2 (12) DO ,2 <- #2 DO ,2 SUB #1 <- #244 PLEASE ,2 SUB #2 <- #188 DO READ OUT ,2 PLEASE GIVE UP
CJam
ri{_p}h;
Clart
< n; ? [n=1]: ^loop E > 0; Q :loop > 1; ^loop
Coeus
hA[AB][][aA]aA
Color Scheme
comp
;{^&}&
Conglument
-.0~a+0b.2*-b~ac.4~+1c
COPY WITH @
?{!}!
Cortex language 3
;'
(by definition)
Cortex language 3A
;'
Counting
when cnt == 1 read acc out acc when acc == 0 halt when acc == 1 out acc
Cratefuck
>*[>>>>>*<<<<<<*[>*<*>>*<<*>>>*<<<*>>>>*<<<<*>>>>>*<<<<<*]>*<*>*[.]]<*>>>>>>*<<<<<<*[>*<*>>*<<*>>>*<<<*>>>>*<<<<*>>>>>*<<<<<*]>*<*>*<*>*.
The program takes the number of crates in room 1 as its input. To input a 0, simply run the program as‐is. To input a 1, prepend *>*<
to the program.
CreativeASM
@ A truth machine, in CreativeASM @ Input int rax 00h @ Jumping beqrax 0 zero beqrax 1 one @ Zero lbl zero put rax 0 int rax 01h slp hal @ One lbl one put rax 1 int rax 01h jmp one
Cubestate
,0 B' .1 F' D' M2 S U' B D S L2 M2 B' 8
CV(N)(C)
soθɰ̊oθʋi
Daoyu
$$$; ( *[=[*] *S=S=S=S=S ( !) =S*S=S=S (/!) =! *S*S=S=S ) ! =[=] *S=S=S=S ((!)) =[=] *S=S=S=S (!) =[=] *S=S=S=S (!)! $$$$ ((/(/(/(/([]!/[]))))) /(((([]!/[]!)/([]!/[]!))/(([/[]!]!/([]/[]))/([/[]!]!/[/[]]!))) /((([/[]!]!/[/[]!])/(([]/[])/([])))/((([])/([]))/(([])/([]/[]!)))))) ((/(/(/(/#)))) SSSSSSS
Dash-end
ø10 ¡a #-- ø30 ? ¢a 0 50 ø30 ? ¢a 1 35
ø32 -þ ø35 --# ¢a ø40 ¤35 ø50 --# ¢a ø60 -þ
dc
?[pd;xx]d1:xx
Deadfish with gotos and input
,iiiis. soh ddddddddddddddddddddddddoiiiiiiiiiiiiiiiiiiiiiiii.
Definer
There is no input in Definer; the line under constants
must be either 0 = 0
for 0-input or 0 = 1
for 1-input. Below, 1-input is used.
Output can only occur if the program halts; in the case of 1-input, this program will produce an ever-expanding string of '1's.
constants: 0 = 1 definitions: 1 = 11 code: 0
And, just another all-input usable way:
constants: 1 = 11 definitions: code: 0
Defunc
Ta?.a0Ta0 T,
Detour
v-1 -1 0 -1? -1^ -1 1 -1? 0 1 0: -1^
Difficult
a=thing.console.Input("")? thing.keyword.switch a[ thing.keyword.wheneq 1[ thing.keyword.while true[ thing.console.printnd{a}? ] ] thing.keyword.wheneq 0[ thing.console.printnd{0}? ] ]
DigFill
(&n*)n^n~n(&n~s)s~s
DINAC
SET zeroOrOne:\0 IN zeroOrOne IF zeroOrOne = '1 WHILE 01 OUT '1 ELSE OUT 00
dotlang
•W~ W0`s#0# W1`s#1>#v ^<<
Dot's
/-(e #) .--?-*-------~-$false$-& it is 0 if not 1/true | | \-(p #)-/ .------(c 1)-(e true) .-------(c true)-$true$-(e true)
DotSF
.A__[:b$Ba]:
Double
GV SX 00 SY 00 PV CJ 00 05
Drive-In Window
Hi, welcome to Spill_The_Beans. Here is a menu. Vodka: $50 Here are your sides. Truth Serum: $2 May I take your order? OK, how much money should Person 1 have? Let's just do this until Person 1 has no more money! Person 1 would also like the Vodka, hold the Truth Serum. Let's just do this until Person 1 has no more money! Person 1 will pay for his order! Person 1 has no more money! Person 1 has no more money! Person 1 would also like the Vodka, hold the Truth Serum. Person 1 will pay for his order! Just wait while we decide... OK, that will be $48. Thanks for coming!
DROL
nj0002oxk"0001xw0001o
DStack
04KKCKT
Duck Duck Goose
duck duck duck goose duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck duck goose duck duck duck duck duck duck goose duck duck goose duck duck duck duck duck duck duck duck duck duck goose duck duck duck duck duck goose duck duck duck duck goose
Ecliptica
i?48(x)?49([1o])
Eek!
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeEeeeEeeeeeeeeeek! EeeeeeeeeeeeeeEEEeeeEeeeeek!
Egel
tm = [ 0 -> 0 | 1 -> 1 + 10 * tm 1 ] tm <input>
Replace <input>
with 0 or 1
Element
_'{1`}0`
Emmental
;#58#46#58#63#49! ,:.:?
Emoji-gramming
😊🕐💖 😇🕐🕐 😇🕐🕐 😇🕐💖 😇🕐💖 😊🕑🕐 😇🕑💜 😊♈🎤 😵♈💜 😇🚨💕 😊📢🕑 😈🚨💕 😊📢🕐
Empty
I-∅5^∅;∅5^∅o∅5^∅/∅zSoTo∅5^∅:∅5^∅/∅oSzTz∅:
Encapsulation
<000 - 100 1 - 11
EnScript
Please make sure that you add a "9" after your input!
INP A OUT A//19 or 09 LDA Z, 10 ENC A, Z OUT A
Eodermdrome
(0) zero-quits: z (0) quit! z (1) the-loop: (1) on-one: loop-the-loops loop-the-loop (1) loop-the-loop
Eso2D
All non-0 values are treated as 1.
$`v >*@ ^
EsoFur
OwO What's This? Notices Your Input Boop The User For Input Input Nuzzles "1" Howl 0 Nuzzles 5 Marks "1" *Starts Roleplaying* Howl 1 *Stops Roleplaying Because Of Input* QwQ
ESOPUNK
COPY #STDI X TEST X = 49 MARK L COPY X #STDO TJMP L HALT
Excellang
right | out | stop | |
start | vif | ||
right | out | left |
Excellerated Short-Term Memory Loss
GRID: +---+---+ |VIN|QP0| +---+---+ |P1 |< | +---+---+
Exotic
(. (. .)) (. .) (. ((. .) .)) *(. ((. .) .)) a .
Expansion
[1]=1[1] [0]=0 *[input]
You replace input with the input (0 or 1), actually, this doesn't print anything (because the program never halts) when input is 1, but appends 1 to the memory string infinitely.
Expensive
,.[[-<+>>+<]>-]<<<[<<]>[.]<+><>-<-<+<--+<-
Expressions
#0 "var/userInput" = input(int) #1 2 + 1 = 3 - "var/userInput" #2 print("var/userInput")
FALSE
^48-[[$1.!]$!]?0.
FerNANDo
r 0 0 1 1 0 0 0 a a 0 0 1 1 0 0 0 a a
Finvara
(k): (n 0): (0,0) (i 3): (1,0) (p 4): (1,0) (q 0): {(1,0),(1,1)} +--+--+--+--+ |kB|##|qB|nB| +--+--+--+--+ |##|##| | | +--+--+--+--+ |iW|pW| |kW| +--+--+--+--+ Turn 1 W: i a1 -> b1 Turn 1 B: k c1 -> c2 Turn 2 W: p a2 -> b2 Turn 2 B: q c3 -> b3 Turn 3 W: p a2 -> b2 Turn 3 B: n c4 -> c4 Turn 4 W: p a2 checks turn 3 Turn 4 B: n c4 -> c4
><>
i68*-?!v1>:!n< >0n;
Fish Code
<,(((48)))(1)[2]>< <(((208))).>< <(((208))){3}>< <.{3}><
Fishing
v+CCCCCC?=[C] `1`{I}! P [CC {N
Fist
? 0>0 1>1 >hlt :0 .0 >hlt :1 .1 >1 :hlt
Fit
:(.).
FlinnScrip
input(0); if(0=0){print(0);}; while(0=1){print(0);};
Flipfractal
#V## #/+< >X # #^##
Foobar and Foobaz and Barbaz, oh my!
? and 255 and 0, oh my. 2 and 2 and ., oh my... 5 and 5 and 5, oh my... 0 and 0 and ., oh my. 3 and 3 and 3, oh my...
Fool
To pass a 0 as input, run the program as‐is. To pass a 1 as input, append .*
to the last line to set cell 0 to 1.
stepLeft:*.<.*.>|stepLeft&*.< glideLeft:glideRight&stepLeft stepRight:*.>.*.<|stepRight&*.> glideRight:glideLeft&stepRight main:*.(glideRight.<.*.*.>.*|*)
Forobj
n>n["0"d][[,"1"d\],[]$n"1"=?]$n"0"=?
Forte
10 GET 5 20 LET 40 + ((5 - 48) * 10) = 30 40 PUT 5 : END 50 LET 40 = 29 60 LET 61 = 60 + 61 61 PUT 5 : LET 60 = 61 + 1
FOS-X
This checks for the press of the 1 key on the keyboard as input for 1. All else assumed 0.
01 05 05 05 05 05 01 04 06 06 01 04 04 3B 04 21 2C 23 01 17 34 13
FROM HERE TO THERE
FROM IN TO n FROM "0" TO 6 FROM "1" TO 4 FROM n TO LINE FROM 1 TO OUT FROM 4 TO LINE FROM 0 TO OUT
Fueue
[[)[~~~~()+1])])][[)$-----~1-[~:)~)[)[~:)~)]~:]:]~[~[$~H~~%~+])~48-):])~)~:])][)~[0]])$
Funciton
╔═══╗ ╔═══╗ ║ ╟──────┬──────╢-49║ ╚═══╝ ┌┘ ╚═══╝ ┌┤ ┌┐ ┌┘└┬┘└┐ │╔═╧═╗│ ╔════════════════════════════════════════════════════╗ │║255║│ ║ Funciton Truth-Machine v0.6 ║ │╚═══╝│ ╟────────────────────────────────────────────────────╢ └──┬──┘ ║ 0: Output "0" and terminate ║ │ ║ 1: Infinite loop, no output. Fill memory with "1" ║ │ ╚════════════════════════════════════════════════════╝ ┌┴┐ └┬┘ ┌────┴────┐ │ ╔═══╗ │ │ ║ 0 ║ │ │ ╚═╤═╝ │ │┌───┴───┐│ └┼─┐ ┌─┼┘ ├┐│ │┌┤ └┘│ │└┘ ┌┴┐ ┌┴┐ └┬┘ └┬┘ ╓───╖ └─┬─┘ ║ ∞ ║ ┌───┴───┐ ╙─┬─╜ │┌─────┐│ ┌─┴─┐ ││╔═══╗││ ╔══╗ │┌─┐│ ╔╤═════════════════════════════════════╗ ││║048║││ ║21╟─┼┴─┘│ ║│ Infinite loop with character append ║ ││╚═╤═╝││ ╚══╝┌┴┐ ┌┴┐ ╚╧═════════════════════════════════════╝ │└──┤ ││ └┬┘ └┬┘ │ ┌┴┐ ││ └─┬─┘ └──┤ │ ││ ┌─┴─╖ └─┘ ││ │ ∞ ║ ┌──────┘│ ╘═╤═╝ │ ╔═══╗ │ │ │ ║049║ │ │ │ ╚═╤═╝ │ │ │ ┌─┴─╖ │ │ │ ∞ ║ │ │ ╘═╤═╝ │ └──┐└┬──┘ └┬┘ │ │ │ │
Functional()
E S O L A N,G E(A(S,N E(~ S S)),~)E
FurryScript
It does not do interactive I/O; output is only at the end and input is only at the beginning, so like Kipple and Squishy2K it won't work (unless perhaps, it can use lazy evaluation while knowing the stack effect in advance that it won't use up the data on the stack).
1[ <1> 1# ] PAR DUP ~#
Func[]
Truthmachine[x ? 1 >]$ F.i
G#
integer assign i as input make main; [ if #i is 0 [ print(0) ] orif #i is 1 [ loop [ print(1) ] ] ]
Gaot++
bleeeeeeeeeeet bleeeet bleeeeeet bleeeeeeeeeeeeet bleeeeeeeeeeeeet bleeeeeeeeeeeeet bleeeeeeeeeeeeet bleeeeeeeeet bleeeeeeeet
Gentzen
<- "stdlib"; <- "iolib"; do_zero : () / ($1(iosys) |- $2(@ ++)); do_zero = [io,lp] cut '0' [x] loop x lp [_,_,k] outbyte io x k; do_one : () / ($1(iosys) |- $2(@ ++)); do_one = [io,lp] cut '1' [x] loop x lp [_,k,_] outbyte io x k; truth : () / ($1(iosys), $2(|\|) |- $3(@ ++)); truth = [io,n,lp] cut '0' [z] cmp n z (do_zero io lp) (do_zero io lp) (do_one io lp); main : () / ($1(iosys) |- $2(@ ++)); main = [x,y] cut ([z] inbyte x) ([z] truth x z y); -> main;
GetWhen
when(!input()): output(0), ip=% //If input is 0, output 0 and terminate. when(input()): output(1) //If input is 1, output 1 forever.
Note: This program would create a lot of unnecessary lines that are not executed. Below is a more memory efficient program:
1: x=input(), output(x), ip=x+2 //Output the input, then go to line 2 if it was 0 or line 3 if it was 1 2: ip=% //Halt 3: output(1)
Glass
{M[m(_x)0I!0c.?1O!1o.11?22"1"5S!5e.?=/(_x)11?\]}
Glypho
- Shorthand notation:
11+ddddd**>++* ido d>-+[\o\]
- ABC notation:
aabc aabc abba abab abab abab abab abab abbc abbc aaba abba abba abbc aaab abab abbb abab aaba abca abba abac aabb abbb aabb abcb
- Self-documenting Glypho code:
ffirsstpussuhfhforortytyeieighghtoonthhesstsaccak..kXYYZoooutptputttififeeqeualutoot4848lloopaaannddoutu
Godencode
128 64 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 5274138347969299176434456201135616 196346015741787058376047850806398220574659123509750476440032701530569170245144050568342208862304687500000000000 10548276695938598352868912402271232 196346015741787058376047850806398220574659123509750476440032701530569170245144050568342208862304687500000000000 8 5274138347969299176434456201135616 18432 10548276695938598352868912402271232 12
Gofe
,.[.]
Goldfuck
1.6180399887448948492045868346656381177213091798057648621354486207 052604618189094497072672041883911373847540840753818917521266334622 237369317930800607667263844333860865957395829456383226613399282912 6788037520876689253171163620703222107321626954852629631361448
To let it run correctly, you have to remove all the line feeds.
GolfScript
~{..p}do;
golfuck
:{;};
GotoScript
# Get input 1 GOTO 4 IF INPUT = 0 # Print 1 infinitely 2 PRINT 1 3 GOTO 2 # Print 0 4 PRINT 0
Grawlix
?(=^)>+[=]
Gray Snail
INPUT 01 GOTO zero 0 [01] GOTO infinite 1 [01] GOTO end a a infinite OUTPUT 1 GOTO infinite a a zero OUTPUT 0 end
Gregorovich
Replace the ^1
with ^0
for input 0.
^1_Rega,2-1_W(a>0)[#a]_#a
GridScript
#TRUTH MACHINE. @width 9 @height 5 (1,1):START (3,1):INPUT INT (5,1):GO EAST (7,1):SWITCH =1 (7,3):PRINT 1 (7,5):GO WEST (5,5):GO NORTH (9,1):PRINT 0
Heck
6003009401200301
Hello Fuck!
,[.].
You use Hello
for 0 and World
for 1.
Help.
inp one $0 sub $0 30 $0 if_ $0 jmp 6 out 30 end out 31 jmp 6
Hexadecimal Stacking Pseudo-Assembly Language
110000 420000 400000 030000 010001 000000 420000 400000 120000 010000 000001 120000
Hexagony
?!':)!
Or, properly formatted:
? ! ' : ) ! .
Highways
########### # ! ! # # /- !# # !| \ # #!v \ |!# #--O---/ # #?^ v!! ! # ###########
Hollow
{1}> {.0}\>|>> {1}: {0}:?
Hot
S(S(K(S(K(S(S(SKK)(KK))))(S(S(KS)K)(S(S(KS)K)(K(S(S(K(SS)))(S(K(SS)))(S(SKK)(SKK))))))))(S(SKK)(K(SK))))(S(SKK)(KK))
How dare you fuck the brain
# I for 1 or empty for 0 N/H)
Another one
# I for 1 or empty for 0 N) H
HQ99+LUFTBALLONS
======================================== ooooo oo oooo oooooo o oooooooooooooo o|||||o||o|||| |||||| |oo|||||||||||||| ||||||||||||||o||||||o|||||||||||||||||o |||||||||||||||||||||||||||||||||||||||| HQ99+LUFTBALLONSHQ99+LUFTBALLONSHQ99+LUF ========================================
HQ9funge
1 byte solution, shorter than everything else on this list.
T
HQ9funge!
Not anymore.
Hurgusburgus
i(48)^:?{(1)o}?;(0)o@
HZCode
下空右说停空 右听分下空左 空空右右说上
H🌍++
fcku1!0u
Ice box
@;"0"~}[v]:x >:<
Integ
}()([())?(-(48)({()))(](48))(?(-(49)({()))(~()(](49)))())
INTERCAL-72
You have to input either
ZERO
, OH
, or ONE
to this program.
PLEASE DO(1)NEXT (3)DO FORGET #1 DO READ OUT #1 DO (3)NEXT (1)PLEASE DO(2)NEXT DO NOT FORGET #1 DO READ OUT #0 PLEASE GIVE UP (2)DO WRITE IN .1 DO (1020)NEXT DO RESUME .1
Introduce yourself
Hi, I am a, I am 0 years old. The age of a is now a secret. How old are you, a? Are you 1 years old, a? Pardon me, please say line 3 again.
IRP
<mRoman> Would somebody please say 0 if the next number I say is 0, or say 1 in an infinite loop if the next number I say is 1?
ISCOM
$=1 1=@ ?[1]=0 #=FALSE ?[1]=1 #=TRUE #=END ;;TRUE @=1 #=TRUE ;;FALSE @=0 ;;END
Isolated
00000011 11000000 10000100 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 10111100
itflabtijtslwi
/ /// // GGChGG /0P1/0/ /./<\\\\>\\\\\\/ /P0/ 1 ./<.\>./<.\.\.\.\>.\.\.\.\.\.\./ ./P.0./P.2./ ./P.1./P.0./ ./<.\>././ ./P.\2./P.0./ P.1 / /P1/P0/ /<>// /P2/P0/ ChP1
It's not a mistake it's an esolang
(A Truth-machine) (We first get input) it's not an ordinary PNGtuber ⭐it's a no⭐ (Comparison time) it's not comparison ⭐it's a 0⭐ (position) and ⭐it's a 1⭐ (value) and ✨it's an overwrite✨ (operation) it's not comparison ⭐it's a 0⭐ and '__JELLY_INPUT and ✨it's a compare equalness✨ (jumps to the part we print 1 if comparison is true) it's not a minecraft PNGtuber ✨it's a pain and suffering✨ and comparison (the part we print 0) it's not JellyBean ⭐it's a 0⭐ (end program) it's not a mistake ✨it's a masterpiece✨ (the part we print 1) it's not an ordinary game ✨it's a pain and suffering✨ it's not JellyBean ⭐it's a 1⭐ it's not a minecraft PNGtuber ✨it's a pain and suffering✨ and ⭐it's a yes⭐
ΙΧΘΥΣ
ι # above line increments accumulator to 1, delete above line for 0 Ις ΣχΧΘ ΙσΧιιθιιιθχΘ ς ΙΣΧιιθιιιθΥΣΘ ς σΥ
Jaune
This implementation handles any positive integer number greater than zero like the input 1.
v+1:^1?.
Jolverine
.*.....*......*......*......*......*.....*...*...*......*.....*..*......*.... . . . . * . . . . . . * . . . . . . * . . . . . . . . . . . * . . . . . . * * . . . . * * . . . . * * . . . . . . *
JSFuck
This is just a JSCrew.it conversion of `function t(f){{alert(f)}if(f)t(f)}t(+prompt())`. If you know of a <3225 character JSFuck Truth Machine please replace this.
[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+!![]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]])()((![]+[])[+[]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+[]]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+([+[]]+![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+[]]]+([+[]]+![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+[]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]+[+[]]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]+[+[]]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(+(!![]+!![]+[+!![]]+(+[])+(+[])+(+!![])+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![])))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([]+[])[([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]][([][[]]+[])[+!![]]+(![]+[])[+!![]]+([]+(+[])[([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+(!![]+[])[!![]+!![]+!![]]]](!![]+!![]+!![]+[+[]])+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]])
Jug
Since Jug has no input function, the second line "fill(0);
" must be omitted (for 0) or not (for 1). Below, it is not omitted.
jug(0, 1); fill(0); echo(volume(0)); drain(0){ echo("1"); };
JUMP
0 IF 0 THEN GOTO 2 ELSE GOTO 1 1 OUTPUT 1 GOTO 1 2 OUTPUT 0 GOTO 3
Binary form:
110010000100110110010
Juna
0 . 0 1 2 1 0 . . . 2 0 . 2 2
Karma
86*?-, \\;@<
Kava
plug var in; Kava.function one; (print|1|;f[one||]) Kava.function main; (var|i;(user)| if [i=1]?=f[one||] unless?=print|1|:)
Keg
?\1=[{1.}|_0]
KimL
var.decl string a io.in a One: io.out a ctrl.goto One if a = "1"
Kipple
Kipple only produces output if the Kipple program halts, so it is not possible to output an infinite number of 1 characters. However, the following program is probably a Kipple truth-machine in principle.
i>a-48 a? (a 49>o) 48>o
Kkipple
This program is very similar to its Kipple equivalent, but it actually works since Kkipple adds interactive I/O.
io>a-'0' a? (a '1'>o*) '0'>o*
Kolmogorov
a\49\1 +*i o* -*\48 [* o\1 ]
L00P
(:|;:(|&))
Labyrinth
? :! !:@
LCCBED
icw(==0)w0eew(==1)oe
Left-Right March
i00s54b11c54p00j14c55r00p00l00
Lightlang
?!&#&/!/
Enter nothing for 0 input
Linguine
1[0?,0~48:2]3 2[0$]0 3[0$]3
Loadstring
set_length 2 0 load 1 0 get_character 0 1 compare 0 1 print 0 1 jump_equal 12
LOCK
{main :a $a ^a ?one <main } {one $a }
logOS
Editor paste\nswitch Email\nsend\nswitch Terminal\nrun replace "\n" with newline cut minimise LOOP paste minimise Email refresh copy switch Editor paste replace "1" with "switch LOOP\ncopy\nswitch Terminal\npaste\nrun" replace "\n" with a newline replace "0" with "rem" cut minimise Terminal paste run
LOLGraphics
HAI 3.4 0 10
IM IN UR CODE EXECUTIN UR KOMANDZ
I HAS A ONE BYTE DAT IZ CALLED X
PLZ PRINT ONE BYTE X
PLZ ASK TEH USR 2 GIMME A ONE BYTE X
PLZ ASK CEILIN CAT 2 NOD
WHILE CEILIN CAT IZ NODDIN PLZ RUN PRINT
IM OUTTA UR CODE
IM IN UR SUBPROGRAM DAT IZ KALLED PRINT
PLZ PRINT ONE BYTE X
PLZ ASK CEILIN KAT 2 CHEK IZ [X]==1
IM OUTTA UR SUBPROGRAM
Look!
Note: Look! is a sound-based language and the following line of text is only the notes of the real program, for the real program please see the link below
G# G G A# F B F# D G C A A D# G C# G# D C# A A A F# A A C# G F# F C#
The program as a MIDI file.
Losescript
T
Lossia
l Loss l llIIIIll l[ l. ll l_
Ly
n:u![;]1[u1]
Madbrain
r 1 = 1 p 3 j
MailBox
box 0 (once) send "Hello, World!" to 0 (from 0) output
Malbolge
(aONMLKJIHGFEDCBA@?>=<;:98765FD21dd!-,O*)y'&v5#"!DC|Qzf,*vutsrqpF!Clk|ih gfed9(T&6KoOHZYXWVUTSRQPONM]KJIHGFEDCBA@?>=<;:9876"'~g|edybav_zyxwvotsrq pSnPlOjibKfedcba`_XA??ZYRW:UTSLQ3ONMLK.IHGFE>CBA@?"=<;:38765432s0/.n,+*) j!&%f{"!~}|_zyxZvYnsrqpRnmlkjML:f_^GF!
Normalized:
jivvvvvvvvvvvvvvvvvvvvvvvvvvv<ivv*jovv/vvovvoivvv//v*vp<ivvvvvvvji*vv<vv vvvv*/o/jp<opvvvvvvvvvvvvvvivvvvvvvvvvvvvvvvvvvvvvpopjpjjpjjpjooooopoooo ojo*ojoopjoooooooopj*joopojooopo*ooooojooooopooooojoooopooooooojooo*oooo jpoojpooooojooo*ojpoooo*ooooojj/oppjji
Malbolge Unshackled
(aONMLKJIHGFEDCBA@?>=<;:98765FD21dd!-,O*)y'&v5#"!DC|Qzf,*vutsrqpF!Clk|ih gfed9(T&6KoOHZYXWVUTSRQPONM]KJIHGFEDCBA@?>=<;:9876"'~g|edybav_zyxwvotsrq pSnPlOjibKfedcba`_XA??ZYRW:UTSLQ3ONMLK.IHGFE>CBA@?"=<;:38765432s0/.n,+*) j!&%f{"!~}|_zyxZvYnsrqpRnmlkjML:f_^GF!
MarioLANG
;[!:! ==#== >:< "==
Mark
In Mark
In Simple Mark
Mark(down) Input Conditional Turn(down) Turn(right) Console(right) End Turn(right) Turn(up)
Math++
2+2*!?>$ 1>out 2>$ 0>out
Maze
##,##,##,##,## ##,##,^^,##,## ##,##,<<,##,## ##,..,AA,%D,## ##,>>,##,>>,## ##,(),##,%U,## ##,##,##,##,## AA-> IF ==0 THEN %L ELSE %R
MechaniQue
@^? @{_1}^->one @{_0}^->zero @[one]^:1|->one @[zero]^:0 @fin
Metatape
xi[o(])
Microscript
i{p
MineFriff
0,:?vo o,1<
Replace the "0" in the top-left corner with "1" to change input.
Minifuck-2D
This was created using the interpreter on the talk page and therefore may not align with the ideas of the creator.
!<.<! <. !<! ! ! !<! !<! !<! !@!<<<<<!<<!<<<!<!@<!@ @.<@
Minim
#> [0].
_> 1.
#< [0].
_< ?[0].
_> 0.
$< '\n'.
Minks
a INP a OUT a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC x a DEC b a DEC loop a dec a b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b INC b DEC loop b dec b loop OUT
MIX (Knuth)
The following has quotation marks since it has a space in the first character position (the quotation marks should not be punched into the card). Expects input in typewriter (one character only, at leftmost position) and output also in typewriter.
" 0 R6 A R4 0 AP 7A7I F 7V 0 R7 E 9 BE "
Modulous
[INP INT][JMP F 3 IF 0][JMP F 4 IF 1][RST][PRT INT][END][DUP][PRT INT][JMP B 2]
Monicelli
Lei ha clacsonato voglio antani, Necchi come se fosse 0 bitumando il pastene voglio pastene, Necchi come se fosse 1 voglio un barilotto, Necchi voglio un vicesindaco, Mascetti bituma per caso una piccola prova? voglio il genio, Necchi voglio l'intuizione, Necchi come se fosse antani mi porga il genio che cos'è il genio? intuizione: antani a posterdati o tarapia tapioco: barilotto come se fosse antani più 1 stuzzica pastene a posterdati vicesindaco come se fosse antani con scappellamento a destra per 2 e brematura anche, se barilotto e velocità di esecuzione
Muriel
A : ~; .A; D : ".\"1\"; Q : \"D : \\\"\" + |D + \"\\\";\";Q : Q + D;@Q"; Q : "D : \"" + |D + "\";"; Q : Q + D; n : &Q * #A; Q : %Q,0,n; @Q
NoError
:$.$!08-#
Nhohnhehr
+---+ |@/0| |$? | |#\1| +---+
Nice
No Literals, Gotos Only, Final Destination!
\,a a+a+a+a+a+a+a+a+a,b b+a+a+a+a,c ?cb,d :cb*+a+a :cb*+d
NOR
1 0 INP in1 50 MUX in1, 100, 200 100 OUT 0 150 OFF 200 OUT 1 250 JMP 200
NULL
17328365648
Numbers
91 7 8 8 102 ~ 102 8 7
Numeric Topline
16469004801100010
Numobin
)#=*[##-(]##-##--(
Obfuscated
OO0O00OOO00O00O0O0O00OO00OO0OOOO00OO000OO0OO00OOOO0OO0000OO00O0OOO0OO0OOOO0O0OOO0O00O0OO0O0O0OO0000OO0000OO0000OO0OO0O0O000OO0O00OO00OO00OO00O0OOOOOOO0O00OO00O0OOO0O00OOO00O00O00O0OOO000OOO0OO0OOOOO0O000OO00O00OO00OO0OOO0OOOOO0O00OOO0O00OOOOO000OOO0OOOOO000OOO0O0000O000OOOO00O00O0O0O0OO0O0OOOOOOOO000O00O00OO0O0OO0O00OO000O0OOOOOO00OO0O00O0O0OO0OO0OOO0OOOOO0O0O00O0OO0O0O00OO00O0O0OOOOO00O0OOO0OO00OO00O00OO00OOO0OO0000O0O0OOOOO00O00O000O0OOO00OO00OO0OO0O00OOOOO000OOO0OOO000O00000OO000OOOOO0OO00OO00O0OO0OO0O0OO0O00OO00O00O0OOO0000O0O0OOO0O0000OOO000OO0O00O00O0OOOO0OO00O0O0OO0O0O00OOO0O00O000OOO0OO0O000O0OOO00OO0OO0O000OO0O00OO00O00OOOOO00OO0OO00OO0OO000OO0O000OOOO00OOO0O00OOO00O00OO0OO00OO00OO00OO0OO0O000OO00OO0O00OOO0OO0O0OO0O0O00OO00OO0O000O00OOOO0O0O0OOO000OOO0OO0O0OO0O000O0OO0OO0OO0O00OO0O0OO0OO00OOOOO0OO00O00O000OO0OOOOOO00OO0O0OO0O0OO0O00OOO0O000OO0000O0O0OOOOO00OOO0O0O0OOOOO000OO0OO00O0O000O00OO00OOOOO00O00O0OO0O0O000OO00OO0O00O0000OOOO00OOOOOO00OOOO0OO000OO00000OO0O0OO00O0OOOO00O0O0OOO000O0000OOOOO0O00OOOO0O0O000O000OO0O0OO0O0000OO00O0OOO000OO0OO0O00OOO00OOO000OOOO00O0OOO0O0OOOO0O0000O00OOOOO00OOOOO00O0O0OO00OOOO0O0OO0O0OO0O0O0O0OOOO000O00O0O0OO0O00O0OO0OO0OO00OO000OOOOO000OO000OOO0OO0O0O0OO000O00O0O0OO00OO00O0OOOOO00OOOOOO0O0000OO0O000O0OOOOOOO0OO00OO0O000OOO000OO0O00OO00O0OO0OO0000OO0O0OOO0000OOO00000OO0O00O0O00OO00OO0OO00OOO0O00O00O0O0OO0OO0O0O0OOOOO00000OO0O00O0OOO0O0O0OO0O00O0OO000OOO00O0OO0OOO0OO0O000O00000OOO000O00O0OOOO0OO0O00O00000OO0O0OOOOO0000OO00O000OOO0OO0OO000O0OO00OOOOO00OOOO00O000O00O00OO0000OOO0O0OOOO00O0OOOO0O000OO0OO0OO0O0OO0O00OO00OO0O000OOO000OO0OO0O0OOO0000OO0OO00O000O0O0O0O0OOO00OOOOO000OOO0OO0O00OO0O00OOO0O00OOOOO0O0OO0OOO00OO0O00OOO0OO0OOO000OO0O00O0OO0OO00O000OO0OO0OO000OO0O00O0O0OO0OO0O00OO0O00O0OOO0O0OO00O0O0O00OO00O0O0OOO0OOOO0O
ObjLang
e9oCaWZbAwAAAHvaAmVxWwIAAAB72gVpbnB1dFsAAAAAMNoBMTB72gV3aGlsZVsCAAAA6QEAAAB72gVwcmludFsBAAAAcgUAAAAwMHtyBgAAAFsBAAAA6QAAAAAwMA==
Unmarshalled form:
{'if': [{'eq': [{'input': []}, '1']}, {'while': [1, {'print': [1]}]}, {'print': [0]}]}
Odasjoi
woiejd doqije iwejdo oweijw doqije
OneLine
^!~!~
Remove the ^
to set input to 0.
ONE WAY
input push "0 equal if push "0 print else push true while push "1 print push true
OOLANG
start.label; var.Input.0.in; var==0.4.7.ifa; 0.print; .halt; var==1.9.9.ifa; 1.print; start.goto;
ORK
There is such a thing as a truth machine. When a truth machine is to zero: There is a scribe called z. z is to write 0. When a truth machine is to one: There is a scribe called z. z is to write 1. I am to loop When a truth machine is to run a word: There is a linguist called l. l's first operand is the word. l's second operand is "0". l is to compare. If l says it's equal then I am to zero If l says it's not equal then I am to one When this program starts: There is a word called x. There is an inputter called y. y is to readOne x. There is a truth machine called t. t is to run x.
Ouroboros
r.*.n!(
Pain
vN|vN|vN|C<|A<|vD|1+|1+|1+|1+|1+|vD|1+|1+|1+|1+|1+|1+|1+|1+|1+|vU|v*|1+|1+|1+|1+|vU|A>|if(|{|A>|}|)|@
Pair
main inp = ite (eq inp "0") "0" | repeat '1'
Pairpointing
inp = input_num; output_num inp; <>inp? { output_num inp; }
Pass a symbol
^ 0 E 0oX - 1 E 11o - 11 E 1o # i E
PATH
/ \ $,>-}+{v\>-}+{^}.# / \ > ^ \./!}/
pb
^t[B]vb[T]w[B!48]{b[49]v}
pbrain
++++++[->++++++++<]>(.)+(.:),:
PhD
*0*[0~0~*0~]~0~*
Phile
OPEN "stdin.stream"; OPEN "stdout.stream"; READ "stdin.stream" = 0? 5; WRITE "stdout.stream" 1; 1? 3; WRITE "stdout.stream" 0; CLOSE "stdin.stream"; CLOSE "stdout.stream";
Piet
Pistons & Pistons
▢├▢ ┴ ┬ 1 ▢ ▢┤▢┤1 0
To change input to '0', replace
1 ▢ ▢┤▢┤1
with
1 ▢ ▢┤▢ 1 ┴
Pizza Delivery
?[31`]30`.
PlusOrMinus 2
Replace the first +
on the second line with a >
for input 0. Here the code for input 1 is shown.
V v<<< >+|>+++++++++++++++++++++++++++++++++++++++++++++++++>-+^ >++++++++++++++++++++++++++++++++++++++++++++++++->>>>>
PocketFuck
Enlarged view
Actual size
Poetic
Truthful Machine, functioning with epistemological methodologies i wanted to say a truth i do enjoy a true, intelligible saying but i accept, i'm no legit philosopher reality is unknowable
PoGo
if po uf to go
PokéBattle
Trainer 1: Alice Togepi Emolga Talonflame Rhyperior Abra Pikachu Trainer 2: Bob Yveltal Raichu Oranguru Nidoqueen Incineroar Avalugg Battle Start! Turn 0: Alice: Rhyperior Go! Bob: Avalugg Go! Turn 1: Rhyperior uses Leer! Bob tried to run away! You can't run from a trainer battle! Turn 2: Rhyperior uses Fissure! Avalugg uses Blizzard! Turn 3: Alice thinks about Turn 4. Bob thinks about Turn 7. Turn 4: Alice tried to run away! You can't run from a trainer battle! Bob uses Potion! Turn 5: Alice tried to run away! You can't run from a trainer battle! Avalugg uses Barrier! Turn 6: Alice thinks about Turn 5. Bob tried to run away! You can't run from a trainer battle! Turn 7: Alice tried to run away! You can't run from a trainer battle! Avalugg uses Barrier! Battle End! Winner: Alice
Postrado
And now it's time to pack everything up Thank you for I think the bus is titled Why? Because i is 0 Oh. And don't forget the. 0 Why? Because i is 1 I remember some memories with it £ [Oh. And don't forget the. 1] £ I'M QUIT
Powder
{ "if" : { "1" : "infinite_loop", "0" : "halt" } "input" : 1, "result" : "if".'input', "halt" : { "output" : 0 }, "infinite_loop" : { "output" : 1, "result" : "infinite_loop" } }
Powershell
$a=Read-Host if($a -eq 0){ Write-Host 0 }else{ while(1){ Write-Host 1 } }
PRG
VAR ARR CHR UIN SET UIN GET IFT XOR ACC UIN FLS INT POW ADD SIX ONE TWO PUT UIN ELS WHL TRU PUT UIN END END
Print Function Deluxe
$&=1p0 . p1 @2
Pxem
getchar() version
- File name
.i0.z1.o01.a0.pxe
- File content
- don't care
scanf("%d", value) version
- File name
._.w1.o1.a0.pxe
- File content
- don't care
They, actually, can be rewritten to .i0.z1.o.a0.pxe
and ._.w1.o.a0.pxe
respectively.
pyhton [sic]
The following truth machine takes inputs that are not multiples of seven as 1 and multiples as seven as zero. This makes 1 and 0 behave as expected, naturally. Making behaviour undefined for input other than 1 or 0 would have been much simpler, but I only thought of that after finishing the program.
i)))()(9)9))9(())<<<5<53<3<<355<<,,,>,>1,1,,1>>,,666@6@/6/66/@@66 0 07 7 700 hhh?h?.h.hh.??h' ''I ''I '' I l!={#["2!60)]|8]]]]]]]]]]]]]]hI'~99(l];I_=
Puzzlang
X X X X X X X X X X X XX XX X XX XX XX X XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X X X X X X X XX X XX X XX XXX XXX X XX X X
Pyth
Wp
Python
a=input() if a=="0": print(0) else: while 1: print(1)
golfed version by User:Ractangle:
n=1;i=int(input()) while n==1: if i==0:print(0);n=0 else:print(1)
Python but even worse
a=input() if a=="0": print(0) else: while 1: print(1) 1/0
QIRAML
<author>Tetrapyronia</author> <document>This is a QIRAML Truth-machine</document> <help>If the input is '1', print '1' forever, otherwise print input once.</help> <license>GPL</license> <size>1</size> <version>1.0</version> <main> ? Input: if ==1 loop 0 @ @,x </main>
Q-Ref
_innum(x)[_outnumcount(x)x?]
QWOP
OW1P1W1OW0P0
RAGE!!!
<rant> WHY DOES input MEAN THE SAME THING AS WHAT YOU'RE ABOUT TO TELL ME!!! AS LONG AS input MEANS THE SAME THING AS "1": SCREAM "1"!!! SCREAM "0"!!! </rant>
Real Brainfuck
,[.].
Realm
?. 0.. ?.( .( 10001100 ) ) 00001100
RECT4n=GLE
ABB A!B AAB
replace the !
with for
0
and 1
for... well 1
. if 1
it will loops forever and if 0
it will halt
Recurl
Since Recurl has no input facilities, the first line must be either A:<0>
or A:<1>
.
- Using an infinite list:
A:<0> A?0< A:<1,A> > A#0
- Using a loop:
A:<0> A#1 A@0< A#1 >
Recursor
tm(x) = 10 * tm(x) + 1; [0]
Redivider
main: { /0/; "0" } | { /1/; "1" + main["1"] }.
ResPlicate
0 -49 13 1 48 8 1 0 0 4 2 0 49 4 2 48 0
Revapp
(=world (=c (=world)= (('?' putc) ((=self =world (world '1' putc)=world world self (The line below is needed to flush output before infinite loop.)= (=world_unboxed) world ) fix) c '1' equal) ('0' putc) c '0' equal) world getc) main
REVER
(<i,>o) { +d(!x)=[0**x='1',0='0']; +x=0; d=i; *d(x); o=d; x-=1; *'0'; o=d; }
REVERSE
GETXA SKIP PUTXB XB+24 XA-48 REVERSE=XA XB+25 SKIP REVERSE PUTXB REVERSE
Rhokell
(main) = (a (input) (output)); (a (byte (3) (0)) o) = (o (byte (3) (0))); (a x o) = (a x (o x));
RIfP
@inp=0 ;loop $inp !inp 1=1 loop
Because this esolang has no input, input is stored into the inp
variable by the first line, you can change the first line to change the input.
Rock paper scissors
* v?< >$* 01>1< -
Rockstar
Listen to the box If the box is gone Say the box. Else While the box is not gone. Say the box.
ROOP
I wX nw hO
Rouedeux
RRRRRRRRRRRRRRRRRRRRRRRRRRORRRRRRRRRRRRRRWPRRRRRRRRRRRRRRRRRRRRRRRRRRWPRRRRRRRRRRRRRRRRRRWPRRRRRRRRRRRRRRRRRRRRRRWPRQRRRRRRRRRRRRRRRRRRRRRRRRRRWPRRRRRRWPRRRRRRRRRRRRRWPRRRRRRRRRRRRRRRRRRRRRRRWP
For input 1
, add an extra R
to the beginning of the program. Input of 0
prints ZERO
and input of 1
prints ONE
infinitely.
RPG
char in = (1,0) # Will be consumed by the time warp char caster = (1,0) # Will cast the time warp spellbook sb = () merchant m = () potion p = (1) caster buys sb from m in buys sb from m in uses sb casting god_speech() caster uses sb casting time_warp(in) in shouts in buys p from m in uses p end # If in's health is 0, it means he is dead and the loop will not run char _0 = (1,0) caster uses sb casting confuse(_0) _0 shouts
Sadako
| ? : = 0 A A 2 | . A B : = 0 A A 1 | . A A
Sakana
0出停作1出繰作魚
Sailing By
And now the Shipping Forecast, issued by the Met Office on behalf of the Maritime and Coastguard Agency at 0000 today. There are no gale warnings in effect. The general synopsis at 0900. Low Bailey 964 losing its identity by 0200. High Rockall 1061 losing its identity by 2300. The area forecasts for the next 24 hours. Viking, North Utsire, South Utsire, Forties, Cromarty, Forth, Tyne, Dogger, Fisher, German Bight, Humber, Thames, Dover, Wight, Portland, Plymouth, Biscay, FitzRoy, Sole, Lundy, Fastnet, Irish Sea, Shannon, Rockall, Malin, Hebrides, Bailey, Fair Isle, Faeroes, Southeast Iceland. Calm, south 1 in Rockall. Smooth, slight in Rockall. Clear. Good, fog at first in Rockall. And now the Shipping Forecast, issued by the Met Office on behalf of the Maritime and Coastguard Agency at 0200 today. There are no gale warnings in effect. The general synopsis at 0500. Low Bailey 964 losing its identity by 0200 tomorrow. The area forecasts for the next 24 hours. Viking, North Utsire, South Utsire, Forties, Cromarty, Forth, Tyne, Dogger, Fisher, German Bight, Humber, Thames, Dover, Wight, Portland, Plymouth, Biscay, FitzRoy, Sole, Lundy, Fastnet, Irish Sea, Shannon, Rockall, Malin, Hebrides, Bailey, Fair Isle, Faeroes, Southeast Iceland. Calm. Smooth. Clear. Good, poor in Bailey.
SAS-8
INP 8 ADD 9 8 ADD 8 251 ADD 8 250 OUT 9 JMP 8 4
Sayonara
(main x x) (= x (0)) (= x x) (1)
Sceql
______&! \ -= --------= ________= / ==_== \ =*= / =-*
Scratch 3.0
Scratcholang
+*{#1$}/1
Sdac2
,*.*.
SDOTOS
h $ ptg //define a function named "$" and set the Hexagon variable to 0 u#$ //check if hexagon is 0 from input and if so set both variables to 0 f //output hexagon e 3 //goto line 3
Seeker
!x.@x:&.#x=0!0.#x=1!1.|.$0._.|.$1.>1
SELENE.
take start print end print
Self-modifying Brainfuck
1,.[-<->]<[<]>[.]0
Ser2
!'@run-:#:/loop-:'@input-:#: !loop-:'@iopair--:#:'0:/exit-:'@output--:#:'0: !loop-:'@iopair--:#:'1:/loop-:'@output--:#:'1: !exit-:'@iopair--:#:'0:/#:
Setlang++
[[{},0],(0),[(1)]]
Shakespeare
H. Ajax, h. Page, h. Act I: h. Scene I: h. [ Enter Ajax and Page ] Ajax: Listen to your heart. Are you as good as a cat? If so, Let us return to Scene II. Ajax: If not, Let us return to Scene III. Scene II: h. Ajax: Open your heart. Let us return to Scene II. Scene III: h. Ajax: Open your heart. [ Exeunt ]
Shuffle
🃑🃞🂲🂾🃏🂷 🃞🂱🂮🃁🂾🂱🂾
SICKBAY
100 INPUT A% (200+A%) PRINT 0; 200 PRINT 1;:GOTO 200
Silberjoder
See Aubergine or brainfuck for examples.
Simplefunge
>ivv o ^ >V 0 o @
Simplify
a=s()\i|a=="0":\ p("0")\ b\e:\ w|T:\ p("1")
Skibidi Toilet
Skibidi {truth} Toilet "0" Start Skibidi {truth} = 1 Start Skibidi Loop Toilet "1" End Skibidi Loop End Skibidi
Slashist
VAR:<choice>:"" VAR:<ZERO>:{0} VAR:<ONE>:{1} INP:<choice> NCL:ZRO:[<inp> = {0}] CEL:ONE:[<inp> = {1}] LOP:ZRO OUT:<ZERO> NUK: LOP:ONE OUT:<ONE> ELP:ONE
Slim
0@0@0@0@0@0@0@0@0@| :X| :X|@< :X|@< :X| :X| :X| :XX| :^^@^^@<^^^^@0@ :0^^@^^@^^^@^0@0@0@0@0@0@0@0@ :
SMITH
MOV R3, 3 MOV R0, TTY MOV R1, R0 SUB R0, 48 NOT R0 MUL R0, 3 COR +1, +5, R0 NOP NOP NOP COR +1, -3, R3 MOV R0, 48 MOV TTY, R0 STOP MOV R2, 49 SUB R1, 49 NOT R1 MUL R1, 2 MOV TTY, R2 COR +1, -1, R1
Core SNUSP
$,.>++++++!/-<-------->\ /.\!+>>/!?<\?<++++++++>/ \./
Solo
solo
Sokolang
If the input is neither 0 nor 1, it has the same behavior as 1 (print the number infinitly)
### ###d# #@..## ###*.#### #p.*.*.t# ######### --- @:13 t:30 p:11 d:20 --- @[2rdwupdwpu2d3rplwlp2l]+[prw2u2dr]r2updwpu2dlprwpl
Something
<this is a truth machine> INP CBZ 0 LBL 1 <set to one for the machine> ZER ADD 1 VAL GTO 1 LBL 0 VAL
Something?Oops!
? 2?Oops, 0 0?Oops. 0 6?Oops, 0 1?Oops. 0 4?Oops, 1 2?Oops!
Sophie
;@1{[,]}{,&}
SOS
This code actually ignores everything from the first byte of standard input except the lowest bit. Thus entering any ASCII character with even code will output a 0, and any ASCII character with odd codes will output an infinite string of 1s. Of course 0 has an even ASCII code, and 1 has an odd one.
+>???????<-?(+>!!+!!-!!!<-!><)
Spam
I want to tell you a secret, please read line 2. Hear a, please read line 3. Add a by 4, please read line 5. I just want to say, you are fooled. Say a, please read line a.
Splinter
As the language has no input, place 'Z' (for 0) or 'O' (for 1) inside the first {}. Below, 0 is used.
I{Z} Z{\0}O{\1O}I
Spoiler:
∅|^ī?0[0^"∅]?1[1^"<]∅
Squishy2K
Like the truth-machine in Kipple, this is only a truth-machine in principle, as the infinite string of 1's that is generated is never output (at least on the reference interpreter; the language afaik would not disallow implementations that lazily output the result.)
* main { "0"? "0"! "1"? "1" main("1")! }
Stack-based
VAR x I x O x JB x 1
stack-gpt
push ">0ro1" start: len if 1 truthmachine pop printc goto start truthmachine: input if 49 lep push 0 print die lep: push 49 printc goto lep
Stackstack
inputnum while "1" print 1 endwhile "0" print
StaPLe
eval;pop;dup;[if;put;dup;swap;[eval;pop;dup;push;dup;];];dup;get;
*><>
:?`n; !`:n
Starry
, + + + * *' + . '` + . +' `
Stlang
M ./r(i1=={{.$?0}{.1(i@}.0U}{.0(i@}? \
For other versions see Stlang#Truth-machine.
StegFuck
Stop
,:
Struffoli
539003!06%00000000@0@@@000$^
Strvar
Change "0"
to "1"
for input 1. Loops forever for 1 = "1";
, prints 0 for 1 = "0";
.
1 = "0"; # "0" for input 0, "1" for input 1 "1";
Stupid
v=IN v=OUT v==1 v=OUT
stupidExpr
(RESULT = [ (key = [getkey;]); if: (key = "0"), { halt; }, { loop: { print: "1"; }; }; ]);
stupidc
Using VIA library
Toggle bit 0 on the VIA to set the truth.
system(&BE6502); include(&lcd); <Since via.sc is already included in lcd.sc, we don't need to include it again.> onreset({ $lcd.init(&2l); if (?bit(#0), { forever ({ $lcd.printchr(#'1'); }); }, { halt(); }); });
Using PS2 library
Note: This uses the PS2 library, which isn't officially released yet.
system(&BE6502); include(&lcd); include(&ps2); onreset({ $lcd.init(&2l); def (%key); set (%key, *ps2.getkey()); choose ( ?eq(%key, #'0', { halt(); }, ?eq(%key, #'1', { forever({ $lcd.printchr(#'1'); }); } ); });
StupidStackLanguage
htxux
Subleq
Written using Oleg Mazonka's Subleq compiler. This:
(-1) Input a: tmp Input (-1) Input tmp Constant tmp a 0 0 (-1) .tmp: 0 .Input: 0 .Constant: -49
Compiles to:
-1 19 3 18 18 6 19 -1 9 19 18 12 20 18 3 0 0 -1 0 0 -49
Suicide
*vAA:0 *vAB:1 %(vAA::vAB)><vAA <vAA
Replace *vAA:0
with *vAA:1
to change input to 1
SuperPar
![STDIO]=V,IN,OUT !!out{OUT.V=!1;do*@OUT;} !!in{!1=@IN.V;} { machine={ out[#.input]; #.input*48; }; in[machine.input]; do$@machine; }
Super Stack!
input if dup output fi output
Surtic
S1"\n"C1++++++++FC1[C1+++++]FC1[C2+]C2+!B1WB1[IC3?B2(C3==C1)?B3(C3==C2)IB2{OC3OS1!B1}B3[WB1[OC3OS1]]]
Suxesol
As there is no input in Suxesol, the first block must be either [0]
or [1]
. Below, [1]
is used.
[1][0*[?[1.]]0.]
SyL
ke ge no ki yo gihi wewo we ke no yo geha we le wu no wo ku le we yo giho we no wo wo wo ke no yo geha we la wu no wo yo giho we no wo
syncin
"0" 0 def; "1" 1 def; 0 equals input if: 0 var; pleaseendthismiseryrightnow; else: loopstart: 1 var; loopend; endelse; endif;
TableLang
Line Number | Command(s) | ||||||||
---|---|---|---|---|---|---|---|---|---|
1 |
| ||||||||
2 |
| ||||||||
3 |
| ||||||||
4 |
| ||||||||
5 |
| ||||||||
6 |
| ||||||||
7 |
| ||||||||
8 |
| ||||||||
9 |
|
Tables
Input index: "input"
Output index: "output"
If input is not 0
or 1
, the program will not do anything.
On zero, the program outputs 0
and terminates.
On one, the program outputs 1
and goes into an infinite loop (unable to set infinite indices of a table)
Line Number/Index | Instruction/Value | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 |
| ||||||||||||||||||||||||||||||||||
1 |
| ||||||||||||||||||||||||||||||||||
3 |
| ||||||||||||||||||||||||||||||||||
4 |
|
Tag
As there is no input in Tag, the queue should be initially populated with 0
or 1
.
zero :01(p0#) one :11(p1) print:p2!(p1)
Telegram
START INPUT X STOP PRINT X STOP GO TO 2 IF X EQUALS 1 STOP END
TernLSB
Polyglot Truth Machine
The following program behaves like a Truth Machine when running in either TernLSB or StegFuck.
Tetanus
^(!)$|^(!!)(0)$|^(!!)(1)$ \1\1`\2\2\3~\4\5~ !
TheSingularity
TheSingularity:"1",TheSingularity; TheSingularity:"0",TheSingularity:1,1,1;; TheSingularity:_c_,1,1,0; :1; TheSingularity:"1"; TheSingularity:1; :0; TheSingularity:"0";
The Waterfall Model
[[7, 4, 4, 4, 4], [6, 1, 0, 0, 0], [4, 2, 2, 0, 2], [5, 2, 2, 2, 2], [?, 0, 0, 0, 0]]
Second row is the output clock, last row is the input. Using the recommended number encoding, replace ?
in the last row with (input * 2 + 3), i.e. 3
for 0, 5
for 1. On 3
(=0), the output clock will be set to 3
(=0) and the program will cleanly exit. On 5
(=1), the output clock will alternate between 5
(=1) and 4
(NaN?) without terminating.
This=That
a=input a=print while loop i=a~~1 a=print while loop i=end
Thue
a::=::: -0-::=~0 1::=~1 --::=-1- ::= -a-
ThueLike
^>
Tiangou
i p < : : o >
Tier
0.tier
}=_{# >^
Tile
TPPL
ENTER BATHROOM SET RIP ADD ADD ADD ADD CHECK 1 YES? 19 TRASH PULL WIPE PULL WIPE WIPE PULL WIPE RIP FLUSH EXIT TRASH WIPE PULL WIPE PULL WIPE WIPE PULL WIPE RIP FLUSH ADD ADD ADD ADD JUMP 20
Trampolines
|o / # |, ~; # |0 H==H# |= ^- /# | < # | ; # | #####
Trigger
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.$$-111..$-000
Triski
p (v z) (v o) a i v s d s i i (s i i) d d d d d d d d o z v i a l o l l o d d a s s i i (s i i)
Trivial
main io = read io (onReadFlag io); read io = io 0; write io = io 1; onReadFlag io bit = read io (onReadBit io); onReadBit io bit = bit case1 case0 io; case0 io = write io 1 (write io 0) (write io 0); case1 io = write io 1 (case1 io); 0 a b = b; 1 a b = a;
Tsept
?PBKpPxIIPAPAPAPPAABpBPBSPBxDDPAPADPBKB!BKBPBiBxDDPAPADPBKB!BKBPBi
Tttt
hcaaaaibdcbbbbbbcjdcifjf
Tubes
┌─┐ ├┐│ └◆┘ ▶◇◆┤ ▷┘
Turi
[ι]sψ[0]sElz[1]p[1]zl Yp[1]lzl Y⌫ ⌫
Replace ι
with input.
Turing-machine
Q1:E>1 Q0:O>0 E0:E>1 O0:F<0
Turth-machine
Ask for input If the input is 0 Output 0 Whereas if the input is 1 Repeat infinitely Output 1
ulilang
4,0,0 4,input,0(or 1) 2,0,input,skipper 1,loop 0,loop 1,skipper
(there is no io in ulilang)
Underload
This is an example of an implementation in a language that has no input facilities, only output. In the first parentheses, use !
for 1-input, and nothing for 0-input. The program below is calibrated for 1-input.
(!)((1)S:^)~((0)S)~^:^
Unfair
Define Player 1's raising number. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Player 1 counts. Label loop. Evaluate Player 1's raising number. If Player 1's counting number is bigger then Player 2's, then do loop again.
Unlambda
``c`@?1`c`|i
UnnumericJS
function truth_machine(input){ if(input==!''+!!''){ while(!''){ console.log(!''+!!''); } }else{ console.log(!!''+!!''); } }
Since JavaScript has no input, UnnumericJS also has no input, so you have to pass !!''+!!''
for 0 and !''+!!''
for 1 to the truth_machine
function.
Unsquare
ioAx>Io<
Urn
(:(1:::a)::)(a:(1:::)(1:::a)::a)
Please note that an Urn program needs to receive an EOF after the input of 0 or 1; no input-collecting (loop) in this language can end if it doesn't reach the end of input (that is: receive EOF).
V++
@IgnoreErrors define inputstr as string = "" function main () command (0x0007,inputstr,null) if (0,inputstr,"0",null) command (0x0005,"0",null) exit end if if (0,inputstr,"1",null) loop () end if end function function loop () command (0x0005,"1",null) loop () end function
V3i
if input = 0; print "0"; end; else; iloop print "1";
Var=Bar
v=1N v=0UT x=v==1 v=0UT x=STOP
Varigen
VenetianScript
Verbose
Untested. Input must be either "NULLA
" for zero or "I
" for one.
GET A ROMAN NUMERAL TYPED IN BY THE CURRENT PERSON USING THIS PROGRAM AND PUT IT ONTO THE TOP OF THE PROGRAM STACK PUT THE NUMBER -III ONTO THE TOP OF THE PROGRAM STACK MOVE THE FIRST ELEMENT OF THE PROGRAM STACK TO THE SECOND ELEMENT'S PLACE AND THE SECOND ELEMENT OF THE STACK TO THE FIRST ELEMENT'S PLACE GET THE TOP ELEMENT OF THE STACK AND OUTPUT IT FOR THE CURRENT PERSON USING THIS PROGRAM TO SEE MOVE THE FIRST ELEMENT OF THE PROGRAM STACK TO THE SECOND ELEMENT'S PLACE AND THE SECOND ELEMENT OF THE STACK TO THE FIRST ELEMENT'S PLACE GET THE FIRST ELEMENT OF THE PROGRAM STACK AND THE SECOND ELEMENT OF THE PROGRAM STACK AND IF THE SECOND ELEMENT OF THE PROGRAM STACK IS NOT ZERO JUMP TO THE INSTRUCTION THAT IS THE CURRENT INSTRUCTION NUMBER AND THE FIRST ELEMENT ADDED TOGETHER'S RESULT
Waduzitdo
A: M: 0 Y J: 2 * T: 1 J: * T: 0 S:
Watnoxt
Do note that, with how this works, any character with an even ASCII code will act as 0 and any that's odd will act as 1.
>>>>>>!? ?..?.? ?..?!?! .?!?.!?
Wave
Untested.
~! STRT in\_"Enter 1 or 0"% if <(ans) = (0)> :( @/`0% ) elif <(ans) = (1)> :( while <True> :( @/`1\n )% )% !! END
WeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeBasic
Input If number of Infections = 0 Then Print Else do Print Loop end If
Wheat
input x if x "0": terminate - v THE INPUT DATA FOR THE TRUTH-MACHINE BELOW (USE "0" OR "1") output "0"
Wheel
I*Y00V$L00V01G00
When
Untested.
out = 1 when out out = in
Whenever
1 2#-read(); 2 defer(1) print("0") 3#-1; 3 defer(2) again(3) print("1");
Where
WHERE =1 INPUT WHERE =0 OUTPUT WHILE ANY =1 WHERE =1 OUTPUT END
Whitespace
Here, each character used in instructions (space, tab, and linefeed) is preceded by S, T, or L, respectively.
S S L T L T T S S L T T T L S S L S L S T L S T S L S S S S T L T S S T L T S L L L L .
Wierd Machine
ICHF0JQI1QL∞
word worm
[input] 「one」⇒「one」
replace [input]
with the input(as words)
wsad
awaswaaswd
W.W.E
½
x-D
:E 8-------> x-----> x8S 8:C 8> :) 8P :( 8< 8P
XENBLN
ČÎx
Xeroxer
change first line to 0 1
for 1, or 0 0
for 0
0 0 0 3 0 1 1 0 1 0
Xjansk
j xks
j with space takes one character as input, x checks if it is 0 and is printed by s.
XMLang
<program> <import id="!std" /> <while> <bool>true</bool> <try> <block> <assign id="n"> <int> <call id="input" /> </int> </assign> <break /> </block> <continue /> </try> </while> <if> <eq> <access id="n" /> <int>0</int> </eq> <call id="println"> <str>0</str> </call> <eq> <access id="n" /> <int>1</int> </eq> <while> <bool>true</bool> <call id="println"> <str>1</str> </call> </while> <call id="println"> <str>Not 0 or 1</str> </call> </if> </program>
XRF
0AFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF FFFFF 1BFFF 31AFF
YASBE
iget value condjump 1 0
Yabasic
input""x
if(x=0)print"0"
while(x=1)print"1";wend
Yboy
,v~1_1:..$^...!
Your
Your Your Your Your
Ypsilax
If a 0 is placed immediately to the right of 'IN:', a single 0 will appear immediately to the right of 'OUT:'. If a 1 is placed immediately to the right of 'IN:', an infinite number of 1's will eventually appear immediately to the right of 'OUT:'.
( ) ( ) ------ ------ N:0N:0 N:1N:1 T: T:0 T: T:! ( ) ! 1! ---- IN: OUT:
Zeno
real i = 0; zeno { for (i=1;i==t;i=1) { // Infinite for loop if i = 1 print(1); }; }; print(i);
Swap real i = 0;
to real i = 1;
to input 1 instead of 0.
Zirconium
no Synthetic Stations
. @ 0 0 # \ ~~~ |\| / # { ?-}-->Q-O-O-->o->o->O-0 { | } |/| | | { % } 0 0 | | { } v v ~ { `-}---o<--o<--O->@->O--{!} ~~~ 0-->0 | ~ 0
with Synthetic Stations
@ ~~~ === ~~~ { ?-}>0-[-0-]-{-! } { | } o [ ] { } { % } 0-[-1-]-{-% } ~~~ === ~~~ (( 0 = N 48 = )) (( 1 = N 49 = 49 * ))
ZOMBIE
ZOMBIE, like Underload, lacks input facilities. For 0, the third line should be "remember 0". For 1, the third line should be "remember 1".
zombie input is a zombie summon remember 1 animate zombie bleck is a zombie summon task go taste remembering input 0 good say "0" bad shamble say "1" around spit animate animate
Ø
fififiÁ˘100 ; Store address for loop counter (initially 0) »fi$ ; Get user input ıı≠Ü≈}≈}≈ ; Check if input is 1 (rotate and compare) »Á100 ; Jump to loop if input is 1 »fi$ ; Otherwise, output the input (0) Ñ˝» ; End program ‹‹¥«œ ; Calculate next loop counter (always 1) fi›Œfl100 ; Increment loop counter »Á1 ; Jump back to the beginning of the loop (infinite loop for 1) Ñ˝» ; End program (unreachable for input 1)
!中文
从用户端读取一个整数 x 并将其转化为布尔值。 如果 x 返回假,就输出 0 ,然后终止程序;否则,无限地输出 1 。
现代白话文
定义布尔值变量 T 。 读入 T 。 如果 T 等于 假 则: 输出 0 。 终止程序。 否则: 重复执行以下代码直到 1 不满足为止: 输出 1 。
λ⁁
⤽&⁋/´^(:):
_/
(0./¯\1./¨\¯\)_/:/ ((10./110¯\))_/l/0X/