Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: extracting all possible n-mers from an array

by teamster_jr (Curate)
on Jun 08, 2006 at 13:20 UTC ( #554272=note: print w/replies, xml ) Need Help??


in reply to Re: extracting all possible n-mers from an array
in thread extracting all possible n-mers from an array

for some reason i immediately thought of colour pallettes.
not the nicest code, but something i knocked up quickly using your algorithm:
my $c; my $cols={map{(chr(65+$c++),sprintf "%02x",$_)}(0, 51, 102, 153, 204, + 255)}; my @letters=qw/A B C D E F/; print "<html><body><table border=1><tr>"; $c=0; for(glob "{@{[ join ',', @letters ]}}" x 3){ s#.#$cols->{$&}#eg; print "<td bgcolor='#$_'>&nbsp;</td>\n"; print "</tr><tr>" if !(++$c %9); }; print "</tr></table></body></html>";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://554272]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2016-12-04 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (66 votes). Check out past polls.