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

Re: a perl quilt

by jlp (Friar)
on Jan 31, 2001 at 04:03 UTC ( #55402=note: print w/replies, xml ) Need Help??


in reply to a perl quilt

This is what I eventually ended up with:
my @s = (1..168); my @q; { $a=rand(@s);push(@q, $s[$a]); splice(@s, $a, 1); @s && redo } print join(" ", splice(@q, 0, 12)) . "\n" for (1..14);

kudos to mikfire for reminding me about the return value of splice.

Update: my splice was off by 1. whoops

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-05-28 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?