We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

User:Tommyaweosme/language that compiles into brainfuck

From Esolang
Jump to navigation Jump to search
add(n) adds n to current cell
sub(n) subtracts n from current cell
left goes left
right goes right
if cell != n: if current cell is not equal to n, do the following code
end ends if loop (required)
printnum prints current cell as single digit (current cell must be 0-9, otherwise glitch)
printascii prints current cell as ascii
print() prints whats in it as ascii (ruins current cell)
inputnum saves input to current cell as single digit
inputascii saves input to current cell as ascii
forever: repeats next part of script forever
celltoascii(): turns current cell into ascii
celltonum(): turns current cell into number

WHAT THEY COMPILE TO

add(n) + repeated n times
sub(n) - repeated n times
left <
right >
if cell != n: - repeated n times and then [
end go back to what cell that the if was refering to, [-]] and then + repeated n (from if) times
printnum ++++++++++++++++++++++++++++++++++++++++++++++++.------------------------------------------------
printascii .
print() for every character in it, do [-] and then + the same amount of times as ascii value, then ., repeat
inputnum ,------------------------------------------------
inputascii ,
forever: [-]+[ then code, then go back to cell that was on when forever loop started then [-]+]

MY SCRIPTS IN IT

hello world

print(hello world)

cat

forever:
inputascii
print ascii

99 bottles of beer on the wall

forever:
add(9)
right
add(9)
left
printnum
right
printnum
right
print(bottles of beer on the wall)
left left
printnum
right
printnum
right
print(bottles of beer
take one down
pass it around)
left
if cell != 0:
sub(1)
end
if cell != 1: if cell != 2: if cell != 3: if cell != 4: if cell != 5: if cell != 6: if cell != 7: if cell != 8: if cell != 9:
add(9)
left
if cell != 0:
sub(1)
end
if cell != 1: if cell != 2: if cell != 3: if cell != 4: if cell != 5: if cell != 6: if cell != 7: if cell != 8: if cell != 9:
print(no more bottles of beer on the wall
go to the store, buy some more)
celltonum(9)
right
celltonum(9)
end
end