its really that small? :o
+++ ++++[<+++ +++ +++>-]<[<++>-]
That's set to 0x7E or 126 in the regular code. The test works for any value.+[-,> // notice the similarities of this code to the main interpreter loop code of "+[-,>+]"
, // handle the \n most editors insert after input where the character code for \n is 0x10
----------[++++++++++>] // subtract 0x10 from second cell. If still non-zero (for multi-character input),
// restore it and switch to next cll
[-] // zero the value of the cell to operate on (to handle bad interpreter memory initialization)
[<]< // go backwards to the last character entered
[>+>+<<-]+>-[<+>-] // copy character entered out to next two cells
>>>>+++++++[<+++++++++>-]<[<++>-]<< // the character code for "~" is 0x7E which can be factored as 7*9*2
[>-<-]> // subtract the character code from 126
[>>]<< // if 0, move pointer back to value of character in memory
// otherwise nothing happens
[-]< // erase value of cell containing previous character code (if current code is 0x7E)
[-]<+ // clean up memory normally
]
This is incredible. HOW DO YOU DO THIS.
what's Brainf*ck?