brainfuck snippets arithmetical addition |5|3| → |8|0| ^ ^ [<+>-] subtraction |8|5| → |3|0| ^ ^ [-<->] multiplication |10|5|0| → |0|5|50| ^ ^ [>[->+>+<<]>>[-<<+>>]<<<-] division (works correctly with divisible numbers, bugs on indivisible) |8|2|0|0|0| → |0|2|0|0|4| ^ ^ [>[->+>+<<]>>[-<<+>>]<[-<<->>]>>+<<<<] modulo (only works with even numbers, hangs on odd) |6|0| → |0|3| ^ ^ [-->+<] square number |5|0|0|0| → |0|0|25|0| ^ ^ [->+>+<<]>>[-<<+>>]<<[->[->+>+<<]>>[-<<+>>]<<<]>[-] cube number |3|0|0|0|0| → |0|0|0|0|27| ^ ^ [->+>+<<]>[->[->+>+<<]>>[-<<+>>]<<<]>[->[->+>+<<]>>[-<<+>>]<<<]>[-] operational clearing current cell |10| → |0| ^ ^ [-] |–10| → |0| ^ ^ [+] finding next free cell |*|*|0| → |*|*|0| ^ [>] moving cell value to right |10|0|0| → |0|10|0| ^ ^ [->+<] moving cell value to left |0|10|0| → |10|0|0| ^ ^ [-<+>] copying to right |10|0|0|0| → |10|10|0|0| ^ ^ [->+>+<<]>>[-<<+>>]<< copying to left |0|0|0|10| → |0|0|10|10| ^ ^ [-<+<+>>]<<[->>+<<]>> string operation store string until \0 |0|0|0|0|0| → |0|*|*|*|0| ^ ^ >,[>,] echo string 123 → |1|2|3| → 123 >,[>,]<[<]>[.>] echo reversed string 123 → |1|2|3| → 321 >,[>,]<[.<]