Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: recursive algorithm

by GrandFather (Saint)
on Sep 06, 2012 at 00:03 UTC ( [id://991976]=note: print w/replies, xml ) Need Help??


in reply to recursive algorithm

Adding a little sanity checking to evalRna may help you figure out the problem:

sub evalRna { my ($l, $r) = @_; my %bonds = (GU => 1, UG => 1, AU => 2, UA => 2, CG => 3, GC => + 3); my $lu = "$bases[$l]$bases[$r]"; my $numBonds = $bonds{$lu} || die "Bad bond type '$lu' given $l, $ +r\n";

When given your sample input data you get:

Bad bond type '5C' given 0, 21
True laziness is hard work

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-24 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found