aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Goebel <garrett.goebel@gmail.com>2020-12-08 19:33:20 -0500
committerGarrett Goebel <garrett.goebel@gmail.com>2020-12-08 19:33:20 -0500
commit07d9a1cb90b8268487449bc1a109a001787ce3f1 (patch)
tree48b5981546bcf3ae675d030ecfae9590885637ba
parente37762846b7c44fdcafb9d58edf3a7b5f2246747 (diff)
downloadperlweeklychallenge-club-07d9a1cb90b8268487449bc1a109a001787ce3f1.tar.gz
perlweeklychallenge-club-07d9a1cb90b8268487449bc1a109a001787ce3f1.tar.bz2
perlweeklychallenge-club-07d9a1cb90b8268487449bc1a109a001787ce3f1.zip
challenge-090 Task 2 Raku
-rw-r--r--challenge-090/garrett-goebel/raku/ch-2.raku17
1 files changed, 16 insertions, 1 deletions
diff --git a/challenge-090/garrett-goebel/raku/ch-2.raku b/challenge-090/garrett-goebel/raku/ch-2.raku
index b955dd9446..35324621de 100644
--- a/challenge-090/garrett-goebel/raku/ch-2.raku
+++ b/challenge-090/garrett-goebel/raku/ch-2.raku
@@ -1,2 +1,17 @@
#!/usr/bin/env raku
-say TR/TAGC/ATCG/ with 'GTAAACCCCTTTTCATTTAGACAGATCGACTCCTTATCCATTCTCAGAGATGTGTTGCTGGTCGCCG';
+
+unit sub MAIN (Int $A where {$A > 0} = 14, Int $B where {$B > 0} = 12);
+
+my ($a, $b, $r) = ($A, $B, 0); # command line args are immutable
+
+say "$a & $b";
+
+if ($a > 1) {
+ repeat {
+ $r += $b if $a mod 2;
+ say "{ $a div= 2 } & { $b *= 2 } | r: $r";
+ } while $a > 1;
+}
+$r += $b;
+
+say "r: $r";