Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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>";


Comment on Re^2: extracting all possible n-mers from an array
Download Code

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 contemplating the Monastery: (8)
As of 2015-07-04 15:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls