Two commands

From Esolang
Jump to navigation Jump to search

Two commands is a programming language that uses two commands

Commands

0 - add 0 to the start of the code and add 1 to the end of the code
1 - if the end of the code is 1, add 0 at the end of the code as a command, and remove the first digit of the program
EOF - return program

Example

0
infinite loop
0
001
0010
001001
0000010
000001001
...
10
longer infinite loop
10
10
10001
100010
10001001
100010010
10001001001
...
11
short infinite loop
11
10
0101
1010
010101
101010
...