Skip to content

Commit 5153a87

Browse files
author
L. Grondin
committed
solution for rosalind/IPRB
1 parent 6ada933 commit 5153a87

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rosalind/iprb-grondilu.pl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use v6;
2+
3+
sub take-two($n) { $n*($n-1)/2 }
4+
given $*IN.get.split: " " {
5+
say
6+
take-two([+] .[]) R/ (
7+
[+]
8+
take-two(.[0]) , # two homozygous dominant
9+
3/4 * take-two(.[1]) , # two heterozygous
10+
.[0] * .[1] , # one homozygous dominant and one heterozygous
11+
.[0] * .[2] , # one homozygous dominant and one homozygous recessive
12+
1/2 * .[1] * .[2] , # one heterozygous and one homozygous recessive
13+
)
14+
}
15+
# vim: ft=perl6

0 commit comments

Comments
 (0)