Truth-machine

From Esolang
Jump to navigation Jump to search
Not to be confused with Truth Machine (language).

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.

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

!@#$%^&*()_+

0_*(!#)#

/gɹəʊguː/

;<{!<![}&1+,<!]?

@

   ?ň¤Ō10

{}s

# 2<1 0<2 [2, {0<2}]

05AB1E

[?_#

0815

|~}:i:%^:i:

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.]

2KWLang

Requires 3 files: main.2kwl, 1.2kwl, and 0.2kwl. Contents of main.2kwl:

print “\0”;
import ((“\0” == “1”) ? “1.2kwl”: “0.2kwl”);

Contents of 1.2kwl:

print “1”;
import “1.2kwl”;

Contents of 0.2kwl:

print “0”;

33

O[on@]

3x

?([1])[0]

4

3.70050060148102000180250094

4BOD

Truth machine 4BOD.png

><>

i'0'-:?vn;
        :
       >^

Also works for *><>.

ACL

1A54B64BF78

A:;

j:1;i:l;?:l:=:j:2;p:j;g:3

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

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?

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?

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.

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 / &#0;) 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

Backshift

Although it was intended as a sorting algorithm, it turned out to be computationally powerful.

x

x is the input. 1 does the same thing as 0 , 0 does the same thing as 1.

Beam

rS v
>@<)
   @

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 (dead link)

[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

Binary lambda calculus

010001101000000110000000010110111001011110000010010111111011111011110

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!]

Musical version

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

         *
         *

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 1s but doesn't print

boolfuck

 ,>,>,>,>,>,>,>,<<<<<<<
[;>;>;>;>;>;>;>;<<<<<<<]
 ;>;>;>;>;>;>;>;

Brace For Impact

(t@)in(j^)(y~)
(q#)in = 0(j^)
   (f=)
(e%)
   (t@)out(j^)1
   (w&)out = 1(j^)
      (s;)out
      (f=)

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--

.>>>>>>>.[.]

brainfunct

 ////////////////////////////////////////////////.@/,.@

Brainlisp

(in)(out)(loop(loop(dec)(left)(inc)(right)(right)(inc)(left))(right)(dec))(left)(left)(left)(loop(left)(left))(right)(loop(out))

Brainloller

Brainloller Truth machine.gif Short, but needs negative cells. Shorter Brainloller Truth machine.gif

BRASCA

[1n]n

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).

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.

Carriage

111-@1\11-~!$$11+1+1+1+\1+1+1+1+1+1+@11-~!$$1-

An explanation is available.

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

comp

;{^&}&

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

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

dc

?[pd;xx]d1:xx

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,

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
      ^<<

DotSF

.A__[:b$Ba]:

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



Eek

EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeEeeeEeeeeeeeeeek

EeeeeeeeeeeeeeEEEeeeEeeeeek

Egel

tm = [ 0 -> 0 | 1 -> 1 + 10 * tm 1 ]
tm <input>

Replace <input> with 0 or 1

Emmental

;#58#46#58#63#49!
,:.:?

Emoji-gramming

😊🕐💖
😇🕐🕐
😇🕐🕐
😇🕐💖
😇🕐💖
😊🕑🕐
😇🕑💜
😊♈🎤
😵♈💜
😇🚨💕
😊📢🕑
😈🚨💕
😊📢🕐

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
 >*@
  ^

ESOPUNK

COPY #STDI X
TEST X = 49
MARK L
COPY X #STDO
TJMP L
HALT

Excellerated Short-Term Memory Loss

GRID:
+---+---+
|VIN|QP0|
+---+---+
|P1 |<  |
+---+---+

Exotic

(. (. .)) (. .)
(. ((. .) .)) *(. ((. .) .))
a .

Expensive

,.[[-<+>>+<]>-]<<<[<<]>[.]<+><>-<-<+<--+<-

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;

Fishing

v+CCCCCC?=[C]
  `1`{I}!  P
        [CC
         {N

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...

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 ~#

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

GolfScript

~{..p}do;

golfuck

:{;};

Grawlix

?(=^)>+[=]

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

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:

 ? !
' : )
 ! .

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))

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

Hurgusburgus

i(48)^:?{(1)o}?;(0)o@

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

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

ΙΧΘΥΣ

ι
# 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 JSFuck.com conversion of `function t(f){{alert(f)}if(f)t(f)}t(+prompt())`. If you know of a <6520 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*?-,
\\;@<

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*

L00P

(:|;:(|&))

LCCBED

icw(==0)w0eew(==1)oe

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

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

;[!:!
==#==
  >:<
  "==

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.

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]

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

Nhohnhehr

+---+
|@/0|
|$? |
|#\1|
+---+

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

)#=*[##-(]##-##--(

OneLine

^!~!~

Remove the ^ to set input to 0.

OOLANG

start.label;
var.Input.0.in;

var==0.4.7.ifa;

0.print;
.halt;

var==1.9.9.ifa;

1.print;
start.goto;

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>|}|)|@

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

Truth machine 22-2-12-1.png

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<<<
>+|>+++++++++++++++++++++++++++++++++++++++++++++++++>-+^
  >++++++++++++++++++++++++++++++++++++++++++++++++->>>>>

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

Powder

{
	"if" :
	{
		"1" : "infinite_loop",
		"0" : "halt"
	}
	"input" : 1,
	"result" : "if".'input',
	"halt" :
	{
		"output" : 0
	},
	"infinite_loop" :
	{
		"output" : 1,
		"result" : "infinite_loop"
	}
}

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

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

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

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

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.

Sadako

| ? : = 0 A A 2
| . A B : = 0 A A 1
| . A A

Sayonara

(main x x) (= x (0))
(= x x) (1)

Sceql

______&!
\
  -=
  --------=
  ________=
/
==_==
\
  =*=
/
=-*

Scratch 3.0

Truth-machine.JPG

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:/#:

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
   @

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+[r2updwpu2dlprwpl]prw2u2dr

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{[,]}{,&}

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

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")!
}

Stackstack

inputnum
while
  "1"
  print
  1
endwhile
"0"
print

StaPLe

eval;pop;dup;[if;put;dup;swap;[eval;pop;dup;push;dup;];];dup;get;

Starry

 , +             +           +  * *' + . '` + . +' `

Stlang

M ./r(i1=={{.$?0}{.1(i@}.0U}{.0(i@}? \

For other versions see Stlang#Truth-machine.

StegFuck

Truth machine StegFuck.png

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

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
Instruction Name Parameter Table
Jump
Argument Value
*Line Number
Instruction Name Parameter Table
Get
Argument Value
Table
Index Value
0 1
1 3
*Index
Instruction Name Parameter Table
Get
Parameter Value
Table Input
Index input
1
Instruction Name Table of Parameters
Set
Parameter Name Value
Table Global
Index Output
Index Value
output 0
3
Instruction Name Table of Parameters
Set
Parameter Name Value
Table Global
Index Output
Index Value
output 1
4
Instruction Name Parameter Table
Jump
Parameter Name Value
Line Number 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

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-

Tiangou

i p < : : o >

Tier

0.tier

}=_{#
  >^

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

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;

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

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

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

Var=Bar

v=1N
v=0UT
x=v==1
v=0UT
x=STOP

Varigen

Varigen Truth-machine.png

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:

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");

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∞

x-D

:E 8-------> x-----> x8S 8:C 8> :) 8P :( 8< 8P

XENBLN

ČÎx

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

Yboy

,v~1_1:..$^...!

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

Tttt

hcaaaaibdcbbbbbbcjdcifjf

Conglument

-.0~a+0b.2*-b~ac.4~+1c

Your

Your Your Your Your

See also