Undecimal
Jump to navigation
Jump to search
Undecimal is a language invented by User:None1 and it is inspired by Duocentehexaquinquagesimal, which is inspired by Golunar, which is inspired by Unary. It is the same as Duocentehexaquinquagesimal, however it is represented in base-11, in which a space represents ten.
Examples
One Time Cat
We have the brainfuck program: ,.
.
We convert it to a number: 110
(1101100
in binary).
Then we convert the number to base-11: 0
, that's it! The one time cat program in this language is 0
Cat program
395 6
Hello World
39506475 9533058 25786 7 27053602440831326587489371 1 999115475
Kolakoski sequence
5090990028 1 828420 8716368 1498082 76917520713435 6315 849719 9130511168290278823 2709552 32595589356 641363015 09541343832768 6 505400333877047375 19991 480624 690396345366 26903391110444332910 82375251046314740360 0072821639883 7 1 22039201411 533 79088120222887199401 759 4 4
Implementation
A compiler to brainfuck is in Python:
def undecimal2num(x): a='0123456789 ' r=0 for i in x: if i in a: r=r*11+a.index(i) return r def num2bf(x): return ''.join(map(lambda a:'><+-.,[]'[int(a)],'{:o}'.format(x))) def undecimal2bf(x): return num2bf(undecimal2num(x))[1:] print(undecimal2bf(input()))
Generator
A translator from brainfuck is also in Python:
def bf2num(x): r=1 for i in x: if i in '><+-.,[]': r=r*8+'><+-.,[]'.index(i) return r def num2undecimal(x): r='' while x: r='0123456789 '[x%11]+r x//=11 return r def bf2undecimal(x): return num2undecimal(bf2num(x)) print(bf2undecimal(input()))
External resources
- Complete interpreter on Try it Online, based on the Python compiler above, uses the native brainfuck interpreter to execute the code and uses an exclamation mark to separate code and input.