Follow

I wanted to write a prime generator, but all the popular languages already have optimised ones I can't compete with.

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

commented version: gist.github.com/olligobber/044

This version is cheaty:

++.+.++.++.++++.++.++++.++.++++.++++++.++.++++++.++++.++.++++.++++++.++++++.++.++++++.++++.++.++++++.++++.++++++.++++++++.++++.++.++++.++.++++.++++++++++++++.++++.++++++.++.++++++++++.++.++++++.++++++.++++.++++++.++++++.++.++++++++++.++.++++.++.++++++++++++.++++++++++++.++++.++.++++.++++++.++.++++++++++.

Show thread

I left this running overnight and it still hasn't output 229.

Show thread
Sign in to participate in the conversation
Mathstodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!