in reply to Challenge: Another Infinite Lazy List
my @factors = (2,3,5); # Assmue increasing sequence my $seq_len = 10; my $index = 0; foreach my $num (1..$seq_len*$factors[0]) { foreach my $factor (@factors) { unless ($num % $factor) { print "$num "; $index++; last; } } last if $index >= $seq_len; }
-Mark
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Challenge: Another Infinite Lazy List
by tall_man (Parson) on Mar 18, 2005 at 01:13 UTC | |
by tlm (Prior) on Mar 18, 2005 at 02:01 UTC | |
by tall_man (Parson) on Mar 18, 2005 at 07:19 UTC |