hny021
Designed by | User:Hakerh400 |
---|---|
Appeared in | 2021 |
Computational class | Turing complete |
Major implementations | See below |
File extension(s) | .txt |
hny021 is a Turing-complete esoteric programming language invented by User:Hakerh400 in 2021. It is also the first language ever created in 2021.
Overview
Source code consists of two arrays of natural numbers. Their length must be the same and they must contain at least one element. The first array is called A
and the second array is called B
.
We internally keep track of three variables:
h
- Initially 0n
- Initially 2y
- Initially 1
Perform these steps iteratively until y
becomes zero, in which case the program halts:
- Let
a
be the element ofA
at indexh
- Let
b
be the element ofB
at indexh
- Increment
h
by 1 and if it becomes equal to the length of the arrays then reset it to 0 - Check if
y
is odd - Perform integer division
y
by 2 - Perform integer division
n
by 2 - If
y
was odd theny = y + n * a
andn = n * b
Interpreters
Here is a simple interpreter in Python:
A = [6, 1, 5] B = [8, 4, 8] h = 0 n = 2 y = 1 while y: a = A[h] b = B[h] h = h + 1 if h == len(A): h = 0 odd = y & 1 y = y // 2 n = n // 2 if odd: y = y + n * a n = n * b