Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Flattening lists on input to for loops
  • Loading branch information
Paul Cochrane committed Apr 28, 2015
1 parent d8e51fa commit 8a490d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion categories/rosalind/grph-grondilu.pl
Expand Up @@ -49,7 +49,7 @@ ($input-file = Nil)
take ~.[0], ~.[1].subst(/\n/,'', :g);
}

for %dna X %dna -> $a, $b {
for (%dna X %dna).flat -> $a, $b {
next if $a.key eq $b.key;
say 'Rosalind_' «~« ($a, $b.key
if $a.value.substr(*-3) eq $b.value.substr(0, 3);
Expand Down
2 changes: 1 addition & 1 deletion categories/rosalind/tran-grondilu.pl
Expand Up @@ -40,7 +40,7 @@ ($input-file = Nil)
push @dna, $_[0].subst: "\n", '', :g;
}
my ($transitions, $transversions);
for @dna[0].comb Z @dna[1].comb -> ($a, $b) {
for (@dna[0].comb Z @dna[1].comb).flat -> $a, $b {
next unless $a ne $b;
if "$a$b" eq any <AG GA CT TC> { $transitions++ }
else { $transversions++ }
Expand Down

0 comments on commit 8a490d0

Please sign in to comment.