![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
One of my hobbies is quilting, and recently I've been preparing fabric scraps for a scrap quilt. When I am finished collecting and cutting, I will have 168 six-inch squares of distinct fabrics. My plan is to sew them togther in a 12 by 14 block grid. Out of curiosity, I want this quilt to be as random as possible, and I was puzzling over a way to eliminate my human bias for color coordination (or lack thereof) when selecting block positions. Suddenly, it hit me: Perl. I bolted into #perlmonks and with the help of the excellent monks there, this perl quilt generator was created. A few words about logistics - each fabric swatch will be labeled, from 1 to 168. To keep this as random as possible I think I'll probably put all the swatches in the dryer and let them be tossed around for a few minutes, then pull them out one at a time to assign their number. The perl script below will produce a grid of numbers, and the numbers represent the swatch with that number. A round of perl golf also ensued, but I'll let the participants in that post their own code. Here's what I ended up with (with a lot of help from my friends.)
In reply to a perl quilt by ailie
|
|