BrainC Interpreter Remixed by h_sanple Added: | memory pointer and the next cell are bitwise ORed, and the result is assigned to the cell immediately following the memory pointer. & memory pointer and the next cell are bitwise ANDed, and the result is assigned to the cell immediately following the memory pointer. ^ memory pointer and the next cell are bitwise XORed, and the result is assigned to the cell immediately following the memory pointer. ~ inverts the bits of the memory pointer cell. Changed - During execution, the elements corresponding to "Hello, world!"—72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, and 33—are loaded into memory starting from address 0 in that order. - At the end, the value of the currently pointed-to pointer is output, advancing the pointer until its value reaches 0. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This project interprets code written in the BrainF programming language. --- Instructions --- Enter some BrainF code (see the examples section) Then view the output in the "Output" list. If your BrainF code asks for input, keep in mind that you can only enter in ONE character at a time. --- What is brainF? --- BrainF is an esoteric programming language, which runs on a Turing-like machine. BrainF, like a Turing machine uses a "tape" of cells, but each cell is a byte (8 bits) instead of a bit. --- Syntax --- > Increments the memory pointer < Decrements the memory pointer + Increments the cell at the memory pointer - Decrements the cell at the memory pointer [ Starts a loop, if the cell at the memory pointer is not 0, else it skips the loop. ] Ends a loop, if the cell at the memory pointer is 0 , Takes 1 byte (1 character) of input, and puts it at the cell at the memory pointer . Prints the value at the memory pointer, as a character Note: A cell's value will wrap around if it exceeds 255, or is less than 0 --- Examples --- Hello World: ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++. Terribly leaky repeated hello world (very tiny loop part added by @monkeybean2): +[[-]++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.] Echo: +[,.+] Caeser Cyphers: (these do not wrap around at the end/beggining of the alphabet) (by @MonkeyBean2) (+1 shift): +[,+.+] (+5 shift): +[,+++++.+] (-3 shift): +[,---.+] Odd: +>++< [[>>+>+<<<-]>[>>>+>+<<<<-]>>[-<<<+>>>] >>[-<<<<+>>>>]<[-<<+>>]<<<] Suggest more in the comments! Please tell me about any bugs. This was made in 20 minutes (but the description and thumbnail took longer loooooll) Note: BrainF *definitely* stands for BrainFart. Note: All non-printable ASCII characters were stupidly replaced with a space (" "), I should use something else, maybe a hairspace idk Note2:Most BrainF code wasn't working at BrainC. make a new one.
some text are translated made by japanese