icon 

Innominate's Blog


Because bad posts have to go somewhere.

Fizzbuzz in Brainfuck

Posted on Oct 12, 2013

It seems that every programmer when they first learn about fizzbuzz cannot resist writing one in their language of choice. Strangely, many of them will get it wrong.

Some years ago I did just that in Brainfuck. As with so many other attempts to demonstrate solving a trivial problem, it was broken and only mostly worked. This morning I got bored and decided to finish it. Unlike many “Brainfuck” programs, this is not generated by a program.

>>>>>>>>>>++++++++++>++++++[>++++++++<-]><<<<<<<<<<<<+++++++++[>+++++++++++<-]>+[-<+>]<[->+>+<[->>+<<]>>[->+<<<+>>]>>+++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>>[<<<+>+>>-]<<<[->>>+<<<]+>[<->[-]]<[>>>>>+++++++[>++++++++++<-]>.[-]<+++++++[>+++++++++++++++<-]>.[-]<+++++++++++[>+++++++++++<-]>+..[-]<<<<<<<[-]>-]<>>>>>[-]<[-]<[-]<[-]<[-]<<[->>+<<]>>[->+<<<+>>]>>+++++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>>[<<<+>+>>-]<<<[->>>+<<<]+>[<->[-]]<[>>>>>++++++[>+++++++++++<-]>.[-]<+++++++++[>+++++++++++++<-]>.[-]<+++++++++++[>+++++++++++<-]>+..[-]<<<<<<<[-]>-]<[>>>[-]>[-]>[-]<<<<<<[->>>+<<<]>>>[-<+<<+>>>]++++++++++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>>>>>>>>>[-<+>]<[<<<<<+<+>>>>>>>+<-]<<<<<[>+>+<<-]>>[<<+>>-]<<>>>>>>[<<<<+>+>>>-]<<<<[>>>>+<<<<-]>[<<->>-]<<[<.>[-]]><<>[-]>[-]>[-]<<<<.<<<[-]]>>>>>[-]<[-]<[-]<[-]<[-]<<<>>>>>>>>>>.<<<<<<<<<<]

comments powered by Disqus