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.

Bobby

From Esolang
Jump to navigation Jump to search

Bobby is a small, character-based esoteric programming language based on an accumulator. It has commands for incrementing the accumulator by 2, decrementing it by 1, outputting the accumulator, and printing the string "bobby".

Commands

Command Description Python equivalent
b Increment the accumulator by 2 a += 2
o Decrement the accumulator by 1 a -= 1
y Output the accumulator print(a)
B Output the string bobby print("bobby")
O Output the string bobby print("bobby")
Y Output the string bobby print("bobby")

The language is case-sensitive. All characters except b, o, y, B, O, and Y are treated as comments and ignored.

Examples

XKCD Random Number

bby

Implementation

Python interpreter

a=0
for c in input():
    if c=="b":a+=2
    elif c=="o":a-=1
    elif c=="y":print(a)
    elif c in"BOY":print("bobby")