a brain / brainf^^k interpreter brain is a Turing complete language with a data pointer and an instruction pointer with only 8 commands: < > + - [ ] . , > Increment the data pointer by one (to point to the next cell to the right). < Decrement the data pointer by one (to point to the next cell to the left). + Increment the byte at the data pointer by one. - Decrement the byte at the data pointer by one. . Output the byte at the data pointer. , Accept one byte of input, storing its value in the byte at the data pointer. [ If the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command. ] If the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command.
Press s to terminate the program sample brain programs: Hello world: >++++++++[<+++++++++>-]<.>++++[<+++++++>-]<+.+++++++..+++.>>++++++[<+++++++>-]<+ +.------------.>++++++[<+++++++++>-]<+.<.+++.------.--------.>>>++++[<++++++++>- ]<+. echo program: ,[.,] Golden ratio calculator (goes on infinitely): +>>>>>>>++>+>+>+>++<[+[--[++>>--]->--[+[+<+[-<<+]++<<[-[->-[>>-]++<[<<]++<<-]+<<]>>>>-<<<<<++<-<<++++++[<++++++++>-]<.---<[->.[-]+++++>]>[[-]>>]]+>>--]+<+[-<+<+]++>>]<<<<[[<<]>>[-[+++<<-]+>>-]++[<<]<<<<<+>]>[->>[[>>>[>>]+[-[->>+>>>>-[-[+++<<[-]]+>>-]++[<<]]+<<]<-]<]]>>>>>>>]