We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ada933 commit 5153a87Copy full SHA for 5153a87
rosalind/iprb-grondilu.pl
@@ -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