in reply to (Golf): Sieve of Eratosthenes
72, and there's some nasty bits at the end:
sub p{@_=(2..pop);while($a=$_[0]){@_=grep{$_%$a}@_;$_.=" $a";}split' ';}
Be glad I didn't post the regex one.
In Section
Meditations
in reply to (Golf): Sieve of Eratosthenes
sub p{@_=(2..pop);while($a=$_[0]){@_=grep{$_%$a}@_;$_.=" $a";}split' ';}
Be glad I didn't post the regex one.