Numberlang

From Esolang
Jump to navigation Jump to search
Numberlang
Designed by Batata
Appeared in 2021
Computational class Turing Complete
Reference implementation Unimplemented
File extension(s) .numl

Numberlang is an esolang that consists of a functional Turing Complete language using nothing but numbers in a program without the need for commands. Therefore, the code must be as specific as possible and extremely deterministic. It was made by Batata.

Language Overview

Number Meaning
1 Start program.
0 End program.
2 "If" condition.
02 "Else" condition.
3 Upcoming number(s).
4 Upcoming letter(s).
5 Plus sign.
05 Minus sign.
8 The equivalent of a (.
9 The equivalent of a ).
10 Prints ASCII text or number unit.
12 Undefined input.
13 Undefined variable.
14 Undefined string.
777 Expandable ambiguity or certain part of the code.
1000 Variable characterization.
2000 Group characterization.
00000 Loop start.
11111 Loop end.
010101 Repeat forever.
1234321 Chooses random number between two numbers.

Format

The order of priorities in a code is usually:

starting variables/strings/groups
program start
actual code
program termination

To make a variable, you should specify the number corresponding to the variable with a pair of "1000", like 1000 1 1000. This also applies to groups, like 2000 1 2000. In case of the variables, the numbers after the second "1000" is the equivalent of the variable, while in the case of the group, the numbers after the second "2000" are now part of the group. So in the following example:

2000 1 2000 3 1
2000 1 2000 3 2
2000 1 2000 3 3

The numbers 1, 2 and 3 are now part of the group 1.

Notice how the past script used the number 3 before the 1, 2 and 3. This 3 basically indicates that the following number should be executed as a number and not an ASCII code (if it was an ASCII code, this 3 should be a 4). So if I wanted to print the number 5000, I could use:

1
10 3 5000
0

But if I wanted to print the word "Potato", I should use:

1
10 4 080 111 116 097 116 111
0

Given that 080 111 116 097 116 111 is "Potato" in ASCII.

The printing system has some interesting features. One of them is print variables in a efficient way where you don't need a 3 or a 4 after the "10". So in the following script:

1000 1 1000 12
1
10 12
0

The program will print whatever "12" is, with 3 or 4 before the input.

Another interesting feature is the use of groups in the printing system. The output of a group should be all the numbers and letters in the group, separated by spaces and appearing in citation order. For example:

2000 1 2000 3 1
2000 1 2000 3 2
2000 1 2000 4 072 097 116
2000 1 2000 3 4
1
10 2000 1 2000
0

This program output should be 1 2 Hat 4.

Examples

Here are some full programs you can do with Numberlang.

Print "Hello World!"

1
10 4 072 101 108 108 111 044 032 087 111 114 108 100 033
0

This is a simple program. What it does is simply print "Hello, World!". The program uses the ASCII system to convert that bunch of numbers into letters and symbols.

Cat

1000 1 1000 12
1
10 1000 1 1000
0

This script uses the "You can print variables in a neat way" feature. The "12" can be replaced with anything (in a certain parameter) and the output will be the same as the input. Also don't ask me why this is called cat.

Reverse Cat

2000 1 2000 12
2000 1 2000 12
2000 1 2000 12
777
1
10 2000 1 2000
0

This is a little variant of cat where you can store a whole bunch of numbers and recieve the output equal to the input.

Truth-machine

1000 1 1000 13
1
2 1000 1 1000 0
10 3 0
0
2 1000 1 1000 1
010101 10 3 1

This is a fun one. The program uses "if" to check if the input is either 0 or 1. If it's 0, the program terminates. If it's 1, the program will print 1 infinitely. This is a rare example where 0 doesn't appear in the end of the code.

Print all numbers from ___ to ___

1000 1 1000 13
1000 2 1000 13
1
00000 1000 2 1000 8 1000 1 1000 05 1 9 5 1
10 3 1000 1 1000 11111
0

This one uses some basic math but it gives a really cool result. It uses the loop system to print different numbers using variables adding value to themselves.

Coin Flipper

1000 1 1000 1234321 0 1
1
2 1000 1 1000 0
10 4 072 101 097 100 115
02
10 4 084 097 105 108 115
0

This little game uses an RNG system with the numbers 0 and 1. There's a 50% chance of the program printing "Heads" and 50% of printing "Tails".

bepis