Skip to content

Commit c4d576b

Browse files
author
grondilu
committed
Merge pull request #4 from grondilu/master
Adding two more solutions for Rosalind
2 parents fc5a527 + f1e768a commit c4d576b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

rosalind/grph-grondilu.pl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use v6;
2+
3+
my %dna = gather for
4+
$*IN.slurp.match( / ^^ '>Rosalind_' (<digit> **4) \n (<[\nACGT]>*) /, :g) {
5+
take ~.[0], ~.[1].subst(/\n/,'', :g);
6+
}
7+
8+
for %dna X %dna -> $a, $b {
9+
next if $a.key eq $b.key;
10+
say 'Rosalind_' «~« ($a, $b.key
11+
if $a.value.substr(*-3) eq $b.value.substr(0, 3);
12+
}
13+
14+
# vim: ft=perl6

rosalind/subs-grondilu.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use v6;
2+
3+
my ($S, $t) = $*IN.lines;
4+
say gather for $S.match(/$t/, :overlap) { take 1+.from }
5+
6+
# vim: ft=perl6

0 commit comments

Comments
 (0)