Unary

From Esolang

Jump to: navigation, search

Unary is an esoteric programming language designed by Lode Vandevenne in 2005. Unary uses the unary number system as source code. To write a program in Unary, use the following steps:

1. Write your program in Brainfuck.

2. Replace the Brainfuck commands with binary representation as follows:

Brainfuck Binary
> 000
< 001
+ 010
- 011
. 100
, 101
[ 110
] 111

3. Place these commands behind each other, and put an extra "1" in front, so that together they form one large binary number. The last Brainfuck command makes the 3 least significant bits, and the most significant bit is always 1.

4. Convert this binary number to the unary number system, using 0 digits (e.g. 1001 in binary becomes 000000000 in unary).

Contents

[edit] Number of symbols

According to the specification, Unary uses only one symbol. Some say the EOF character has to be counted as well, thus Unary uses 2 symbols. However, in most other Turing tarpits the EOF symbol isn't counted. Unary still has one symbol less than a Turing tarpit that uses two symbols in its specification, since such a language also has an extra EOF symbol.

[edit] Examples

Program that gets a single character and outputs it again

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Cat program, EOF returns 0:

Too large to show here. It's 56623 zero digits in a row.

[edit] Conclusion

Suffice to say, the Brainfuck program Lost Kingdom would generate a very large source file in Unary.

[edit] Links

Personal tools