TernLSBx89
TernLSB is an esolang invented by User:None1, it uses Steganography to store its program.
HELLO, WORLD!
Prints "HELLO,
WORLD!"
-----------------.---.+++++++..+++.-----------------------------------.---------------------------------.<--.--------.+++.------.--------.<--------------------------------------------------------.
Q______!)_90A8I@QH
Prints "Q______!)_90A8I@QH"
XXX
program prints "XXX"
Interpreter
Currently, the esolang has a Python interpreter (which is also an encoder for writing programs in the language), written by the author of the language (User:None1), it requires the Python Imaging Library.
#Usage:#python tlsb.py
#python tlsb.py
import sys
from PIL import Image
def bf(code):
s1=[]
s2=[]
matches={}
tape=[0]*101054970
for i,j in enumerate(code):
if j=='[':
s1.append(i)
if j==']':
m=s1.pop()
matches[m]=i
matches[i]=m
cp=0
p=0
while cp
tape[p]=(tape[p]+1)%89
if code[cp]=='-':
tape[p]=(tape[p]-1)%89
if code[cp]==',':
tape[p]=ord(sys.stdin.read(1))%89
if code[cp]=='.':
print(chr(tape[p]),end='')
if code[cp]=='<':
p-=1
if code[cp]=='>':
p+=1
if code[cp]=='[':
if not tape[p]:
cp=matches[cp]
if code[cp]==']':
if tape[p]:
cp=matches[cp]
cp+=1
def run(fn):
im=Image.open(fn)
d=im.tobytes()
fuck='+-,.<>[]'
b=''
for i in d:
try:
b+=fuck[i%9]
except:
break
bf(b)
def enc(fn,b,o):
im=Image.open(fn)
fuck='+-,.<>[]'
d=im.tobytes()
d=list(d)
w=''
for i in b:
if i in fuck:
w+=i
for i,j in enumerate(w):
d[i]=d[i]//9
d[i]=d[i]*9
d[i]+=fuck.index(j)
if d[i]>=89:
d[i]-=9
d[len(w)]=d[len(w)]//9*9+8
if d[len(w)]>=89:
d[len(w)]-=8
db=bytes(d)
Image.frombytes(im.mode,im.size,db).save(o)
if __name__=='__main__':
a=sys.argv
if len(a)==2:
run(a[1])
if len(a)==4:
enc(a[1],open(a[2]).read(),a[3])
if len(a) not in [2,4]:
print('Must pass 1 or 3 arguments')
Turing completeness
Probably incomplete??