Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 contemplating the Monastery: (20)
As of 2014-12-19 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (90 votes), past polls