Recently I did a lot of practice problems in brainfuck to learn better about how to use it (and to get more competent in general). Today I write a program to manipulate the input such that every word (separated by comma ,
) is printed in reverse, while the commas are kept in place, which I’m quite proud of. Example provided in the statement: Input: Hello,world
Output: olleH,dlrow
Feel free to rip my code (and comments as well) apart and give some pointers on how my code could be improved!
>, 1:read [ ~a:varchar a:in [>+>+<<-] a:0 b:c:in >>>>++++[<+++++ +++++ +>-]<[<->-] a:0 b:in [c:in-44] <[[-]<[<+>-]>>] if c then a:in else <[<<[.<]>[>]>.>]< print reverse then comma , redo a':read ] <[.<] print reverse