b (None1)

From Esolang
Jump to navigation Jump to search
Not to be confused with B.

b is an esolang invented by User:None1.

It is a bf derivative. bf has 8 commands, but b has only 4.

Commands

b has these 4 commands + . > and [. They work like in brainfuck.

Examples

Hello, World!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++.

Since b has only half of the commands, the power of it is very limited.

Interpreters

Python

x=0
for i in input():
    if i=='+':x=(x+1)&255
    if i=='>':x=0
    if i=='.':print(chr(x),end='')
    if i=='[':raise Exception('Unmatched [')

Lua

local x = 0
for c in io.read():gmatch"." do
if c=="+" then x=x+1
    elseif c==">" then x=0
    elseif c=="." then io.write(string.char(x))
    elseif c=="[" then print("Unmatched [") break end
end

See also