Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (17)
As of 2014-07-10 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (210 votes), past polls