Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Building an array, "stripes on a wall"

by Not_a_Number (Parson)
on Jun 12, 2011 at 12:44 UTC ( #909299=note: print w/ replies, xml ) Need Help??

in reply to Building an array, "stripes on a wall"

Just another way to do it:

my $wall_height = shift || 50; my $stripe = shift || 11; my @stripes = grep { $_ % $stripe == 0 } 1 .. $wall_height; print "@stripes\n";

If perchance you don't want a stripe painted on the very top course of your wall, just change

1 .. $wall_height to 1 .. $wall_height - 1

Comment on Re: Building an array, "stripes on a wall"
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://909299]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-11-26 06:00 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls