Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (14)
As of 2016-06-27 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (345 votes). Check out past polls.