This esolang is a brainfuck derivative

From Esolang
Jump to navigation Jump to search

This esolang is a brainfuck derivative is a brainfuck derivative by User:None1.

Syntax

This esolang is a brainfuck derivative programs are the sentence This esolang is a brainfuck derivative written over and over, with wrong characters, separated by line feeds.

Every line with the langth the same as This esolang is a brainfuck derivative represents a brainfuck command. Which command it stands for depends on how many wrong characters there are.

Commands
Number of wrong characters modulo 8 brainfuck
0 +
1 -
2 ,
3 .
4 >
5 <
6 [
7 ]

For instance, the sentence This esolang is a brainfuck derivative itself stands for a + command, while the sentence This esoalng is a brainfuck derivative or This esolang isaaabrainfuck derivative stands for a , command. Additionally, the sentence P@nO~abAF8`aM&Qd2{`L%0}cW7w7#3I=,`sn_Q stands for the [ command because it has no characters the same as This esolang is a brainfuck derivative and therefore 38 wrong characters.

Lines that are longer or shorter than the sentence This esolang is a brainfuck derivative are NOPs. Tabs are treated as 4 spaces.

Examples

Cat Program

This esolang is a brainfuck derivative
P@nO~abAF8`aM&Qd2{`L%0}cW7w7#3I=,`sn_Q
This esoalng is a brainfuck derivative
This esalong is a brainf*ck derivative
This _______ is a brainfuck derivative

(brainfuck: +[,.])

XKCD Random Number

This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainf*** derivative
chosen by fair dice roll
guarranteed to be random

Note: the three stars in the program are MANDATORY, while the last two lines are not. (brainfuck: ++++++++++++++++++++++++++++++++++++++++++++++++++++.)

Hello World

This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
T%js evqlQng Cs a brainfuck derivative
8-i4 @solang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
Fd{s6^solanz is a brainfuck derivative
T>bl6esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
8hrsZe3olang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
/hniNesolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
T'^s-e;olang is a brainfuck derivative
This esolang is a brainfuck derivative
`hks ;Dhlang is a brainfuck derivative
HhFs9;3olang is a brainfuck derivative
{hisRU|olang^is a brainfuck derivative
U"ZX e|olang is a brainfuck derivative
Thxs esolang is a brainfuck derivative
T:4sQes_{:nY is a brainfuck derivative
=|isEesnlang is a brainfuck derivative
This esolang is a brainfuck derivative
|hiv3Xsolang is a brainfuck derivative
This esolang is a brainfuck derivative
ThisF:sohaNg is a brainfuck derivative
^his esolang is a brainfuck derivative
Thiq YIooang is a brainfuck derivative
T"islHsolan7 is a brainfuck derivative
This esolang is a brainfuck derivative
7hi7Keso2aniTis a brainfuck derivative
0h_s|e<ohang is a brainfuck derivative
C4Ks esoDang j{ba brainfuck derivative
ihcs#exo$ang is a brainfuck derivative
Tkis esolang is a brainfuck derivative
NhM"@eSolanJ iD a brainfuck derivative
toisABsolang is a brainfuck derivative
nhJs`Xsolang is a brainfuck derivative
3h2s eso&ang is a brainfuck derivative
>1>v esolang is a brainfuck derivative
T)is esolang is a brainfuck derivative
ThisGesolang is a brainfuck derivative
Qhis esolang is a brainfuck derivative
T=is-'solang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
TNid eRolang is a brainfuck derivative
ThiM#Asolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
ThiN2esol*ng is a brainfuck derivative
ThXe.ebolang is a brainfuck derivative
This e:~la#_ is a brainfuck derivative
ThesG>solang is a brainfuck derivative
TTes en{lOng is a brainfuck derivative
Tjis esolang is a brainfuck derivative
Tvhs esola|g is a brainfuck derivative
X*isnemo$ang is a brainfuck derivative
thls exolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
TJi7 ezolang is a brainfuck derivative
Tpis esolang is a brainfuck derivative
Thi1 esolang is a brainfuck derivative
4his esolang is a brainfuck derivative
TOis esolang is a brainfuck derivative
Uhis esolang is a brainfuck derivative
&his esolang is a brainfuck derivative
Th\Zqesolang is a brainfuck derivative
Dhis esolang is a brainfuck derivative
T*is esolang is a brainfuck derivative
nhis esolang is a brainfuck derivative
yhis esolang is a brainfuck derivative
Thjs esolang is a brainfuck derivative
ThSs esolang is a brainfuck derivative
:his esolang is a brainfuck derivative
[his esolang is a brainfuck derivative
#h=s osolang is a brainfuck derivative
Rhps(Psolang is a brainfuck derivative
Vjim esRlang is a brainfuck derivative
This esolang is a brainfuck derivative
ihiC es8lang is a brainfuck derivative
>hi` esolang isZ] brainfuck derivative
This esolang is a brainfuck derivative
This esolang is a brainfuck derivative
TLAs<esolang is a brainfuck derivative

Interpreter

The following is the interpreter for the esolang in Python, EOF returns 0 (-1 in JIT mode), if you have jitbf installed, this interpreter will JIT-interpret the code with jitbf.

import sys
def bf(code):
    s1=[]
    s2=[]
    matches={}
    tape=[0]*1000000
    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<len(code):
        if code[cp]=='+':
            tape[p]=(tape[p]+1)%256
        if code[cp]=='-':
            tape[p]=(tape[p]-1)%256
        if code[cp]==',':
            c=sys.stdin.read(1)
            tape[p]=(ord(c) if c else 0)%256
        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
try:
    import jitbf
except:
    pass
else:
    def bf(code):
        j=jitbf.bf2jit(code)
        j()
diff=lambda x:sum([j!='This esolang is a brainfuck derivative'[i] for i,j in enumerate(x)])
brain=''
while 1:
    try:
        x=input().replace("\t","    ")
    except:
        break
    if len(x)==len('This esolang is a brainfuck derivative'):
        brain+='+-,.><[]'[diff(x)%8]
bf(brain)