LCCBED

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

LCCBED stands for "Letter Command Brainf*** Enhanced Derivative". It was created by iamn00b in 2021. Its goal was simple: to make a slightly more confusing yet wonderful variation of Brainf***. As of the time of writing (September 20, 2021), there are no implementations of LCCBED available yet.

Language overview

Overall, LCCBED programs work in a similar way to Brainf***: Data is stored in cells, and the program moves the cell pointer around and increments/decrements the cell's value. The main difference is that while Brainf*** uses symbols (<>+-[],.), LCCBED uses letters (explained in the next section). Another notable difference is that LCCBED also has several "ease-of-use" commands, as well as arguments ("()") to ease some of the load off of the programmer.

Instructions

Command Description
f Moves the pointer forward (">")
b Moves the pointer backwards ("<")
p Increments the value of the active cell ("+")
m Decrements the value of the active cell ("-")
w Starts a while loop ("["). If called without arguments, it will use the default argument "while active cell is not 0".
e Ends the while loop ("]"). Note that each "w" must have a corresponding "e", unbalanced w's and e's will cause an error.
() Arguments for a command (e.g. p(10) will increment the active cell's value by 10, w(<20) ... e will repeat the actions until the active cell's value is 20.
r References a cell with an argument of position relative to active cell and returns its value (e.g. p(10) f r(-1) will set Cell 2's value to 10).
a Similar to r, however, it uses absolute references (ref. point is the very first cell).
For example, p(5) f a(1) will set Cell 2's value to 5.
g This command acts as a goto that takes in a number for an absolute reference.
For example, p(23) f p(18) g(1) will move the pointer back to the very first cell.
o This command outputs the active cell's value. It has 2 modes, ASCII and number.
i This command takes in an input's ASCII value and assigns it to a cell. If the input has multiple digits, it will assign the value of each digit to a different cell.
c Converts a cell's "mode" from ASCII to number vice versa, depending on whatever was the cell's mode was before conversion. By default, all cells start out in ASCII mode.
' Text in quotes are comments.
w0e Infinite loop with an invalid command, causes the program to hang and terminate.

Examples

Incrementor

icfw(!=a(1))peo

Simple single-digit addition

ic 'accepts first input, converts it into a number'
f 'moves pointer forward'
ic 'accepts second input, converts it into a number'
b 'moves back to first cell to prepare while loop'
w 'while cell 1 is not 0'
ff 'move pointer to cell 3'
p 'add 1 to cell 3'
b 'back to cell 2'
w 'while cell 2 is not zero'
f 'go to cell 3'
p 'add 1 to cell 3'
b 'back to cell 2'
m 'reduce cell 2 by 1'
e 'jump past this when cell 2 is 0'
b 'back to cell 1'
m 'reduce cell 1 by 1'
e 'jump past this when cell 1 is 0
ff 'go to cell 3'
co 'convert it into number mode, then output its value'
'example: input 2 & 3, output 5'

Without comments

icficbwffpbwfpbmebmeffco

Brainf*** equivalent

,>,<[>>+<[>+<-]<-]>>. 

"Hello, World!" the boring way

p(72)ofp(101)ofp(108)ofp(108)ofp(111)ofp(44)ofp(32)ofp(87)ofp(111)ofp(114)ofp(108)ofp(100)ofp(33)o

"Hi!" the interesting way

p(10)wfp(7)fp(10)fp(3)bbbefp(2)ofp(5)ofp(3)o

Brainf*** equivalent

++++++++++[>+++++++>++++++++++>+++<<<]>++.>+++++.>+++.

Truth machine (thanks, Keymaker!)

icw(==0)w0eew(==1)oe

//TODO: Allan please add content