Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: (Golf) RNA Genetic Code Translator

by tadman (Prior)
on Jul 06, 2001 at 13:54 UTC ( [id://94418]=note: print w/replies, xml ) Need Help??


in reply to (Golf) RNA Genetic Code Translator

My first real attempt came in at 137 characters, not including cosmetic linebreaks:
sub f{ $_=pop;y/UCAG/0123/;s/(.)(.)(.)/substr "FFLLSSSSYY..CC.WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG" ,$1<<4|$2<<2|$3,1/ge;y/0123//d;$_ }
Which I thought was pretty decent, but it's a little behind the times. Strangely when I use the simple, but elegant compression technique introduced by no_slogan, this code expands. I'll have to look into that more.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://94418]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 12:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found