http://qs1969.pair.com?node_id=55402


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