Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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

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 drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-10-20 21:59 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (283 votes). Check out past polls.