Brain$!_* PLUS Tutorial

Welcome to the Brain$!_* PLUS programming language tutorial! Brain$!_* PLUS is an esoteric programming language designed to be minimalistic and challenging. It operates on a simple memory model with a pointer and a set of commands.

Getting Started

To write Brain$!_* PLUS programs, you only need a few commands:

Examples

+ Command

Increment the current memory cell value by 5:

+++++

Explanation: The + command increases the value at the current memory cell by 1. In this example, it's done five times, so the cell ends up with a value of 5.

- Command

Decrement the current memory cell value by 2:

--

Explanation: The - command decreases the value at the current memory cell by 1. In this example, it's done twice, resulting in a value of -2.

Memory Cells (> and < Commands)

Here's a more intricate example:

+++>++<-

Explanation: Here it starts getting interesting. < and > introduce multiple cells, with the command moving to a different cell. The code adds 3 to cell 1, moves to cell 2, adds 2 to cell 2, goes back to cell 1, and subtracts 1. The memory ends up being 2;2, showcasing how < and > control the movement between cells.

Input and Output

Read input, increment the value, and output the result:

,+.

Explanation: This code introduces , and . commands. The , takes a input (number only) so you can input 6 and the current cell gets set to 6. the + increases 6 to 7, and the . outputs the ASCII be version of the cell, 49 is 1, 65 is A and so on.

Division

Division:

++++++>+++

Explanation: The code sets cell 1 to 6 and cell 2 to 3, goes back to cell 1 and divides cell 1 by cell 2 (6/3), causing cell 1 to be set to 2

Power

Power:

+++^^

Explanation: The code sets cell 1 to 3 cubed (3^3)

Functions

A simple function code:

A{+++}
B{AA}
A>B

Explanation:This code creates functions called A and B, running A adds 3 to cell, B runs A twice.

Simple Loop

Let's create a loop to multiply the current memory cell value by 3 and output:

+[->+++<]

Explanation: In this example, we're using a loop structure to multiply the value at the current memory cell by 3. The + at the start is the input, The loop [ ... ] runs while the value in the current cell is not zero. The + command increments the value, the - command decrements a temporary cell. We get the multiplied value in memory cell 2.

Spelling "Hello"

After this point, the code gets extremly complicated and confusing:

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

Explanation: In the code, 9 gets added to cell 2 and multiplied by 8 in cell 8. Achieving 72 which is "H" in ascii. 7 gets added to cell 2 and multiplied by 4, adding to cell 1, getting 101 in memory and printing "e". 101+7 gets "l" which gets printed twice, and finally 108+3 gets "o". finally getting "Hello" in output.

Square Loop

This code is really complicated, good luck figuring this one out:

++[->+>+<<]>>[-<<+>>]<<[>[->+>+<<]>>[-<<+>>]<<<-]

Explanation: This Brainf@*% code utilizes nested loops and pointer movements to square the value in the current memory cell. Let's break it down:

  1. ++: This is like the input number, in this example we have 2 which is the number we will square
  2. [->+>+<<]: The start of the loop moves the input number into cell 2 and 3.
  3. >>: Move to the third cell.
  4. [-<<+>>]: Moves cell 3 to cell 1.
  5. <<[>[->+>+<<]>>[-<<+>>]<<<-]: The loop starts at the first cell, goes to cell 2 and duplicates to cell 3 and 4, and moves cell 4 back to cell 2,
    goes to cell 1, subtracts cell 1 once and starts subtracting cell 2 while adding in 3 and 4, cell 4 gets moves to cell 2. This repeats until cell 1 equals 0.
    Leaving with cell 2 being the original number and cell 3 having the squared number, these values stay in memory

This complex arrangement of loops and pointer movements effectively squares the value in the current memory cell. The final squared result will be in the original cell.

Hello World Example

Here's a Brain$!_* PLUS program that outputs "Hello, World!":

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

Feel free to explore and experiment with different Brain$!_* PLUS programs. The language's simplicity makes it a fun challenge for programming enthusiasts.

Text to ASCII

Brain$!_* PLUS

Use the Brain$!_* PLUS to run and test your Brain$!_* PLUS programs. Enter your code, provide input, and see the output. Have fun coding!

Try the Brain$!_* PLUS.

For more information and advanced topics, refer to the official Brain$!_* PLUS documentation.

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



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