Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Someone Else 37

Forum Addict
Feb 10, 2013
1,876
1,440
168
76 I spent all day today writing a program in Brainfuck that generates prime numbers.

Code:
;;brainfuck >>>>>>>>> +++++++ [->+>+<<]> [[->>>>>+<<<<<]+>>>>>- <<<<[->>>>>+<<<<<]>>>>]  setup
>[-< <<[-]<[-]+<[-]<[+<<[-]<[-]+<[-]<]>>>>>    scan left
[<<[->>>+>>+<<<<<]>>   > [>>-<-<[-]]>[<<[->+>>+<<<]>[-<+>]>>>+<-<-] >>>] >]<+++    scan right
<<[-]<<<[<<<<<] >>>>>>>>>>  >>>>>>>++++++++[->++++++<]>++    print setup
>>[<- [>[-]<[-]]>[<<.>>[-]] <<[->>>>>+<<<<<]>>>>>+>>]    print loop