Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Erlang

Name: Anonymous 2012-10-22 21:06

Does anyone here know erlang?

http://pastebin.com/SBabeHuc

TL;dr Sieve of Erasthonese.

generate(MaxN) spawns a sieve, and sends it each number in {2,3...MaxN}. Each sieve() function represents a prime number, the first coprime number it receives is made into a new sieve() sieve function, and subsequent coprime numbers are passed onto the child. So essentially each number filters out it's multiples, so only primes remain.

I haven't set up the termination yet, but the problem I'm having is maintaining state, given that you cannot forget variables, and one restriction given to me is that sieve can't have args.

Name: Anonymous 2012-10-22 23:39

no

Don't change these.
Name: Email:
Entire Thread Thread List