diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2020-12-09 03:38:22 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-09 03:38:22 +0000 |
| commit | 6698bce7f3ab406b9803dee2e93d72070f5b7cd2 (patch) | |
| tree | 5f078851a376674878b6042e83cd6e6dc3946579 | |
| parent | 97cace20fbc847723804c3e083659cb1858e3f62 (diff) | |
| parent | 84fd44fc915d5ea833e83d2a91114553c18e9438 (diff) | |
| download | perlweeklychallenge-club-6698bce7f3ab406b9803dee2e93d72070f5b7cd2.tar.gz perlweeklychallenge-club-6698bce7f3ab406b9803dee2e93d72070f5b7cd2.tar.bz2 perlweeklychallenge-club-6698bce7f3ab406b9803dee2e93d72070f5b7cd2.zip | |
Merge pull request #2956 from ggoebel/master
challenge-090 task 1 and 2 Raku
| -rw-r--r-- | challenge-090/garrett-goebel/README | 1 | ||||
| -rw-r--r-- | challenge-090/garrett-goebel/raku/ch-1.raku | 5 | ||||
| -rw-r--r-- | challenge-090/garrett-goebel/raku/ch-2.raku | 19 |
3 files changed, 25 insertions, 0 deletions
diff --git a/challenge-090/garrett-goebel/README b/challenge-090/garrett-goebel/README new file mode 100644 index 0000000000..a8aa246dbb --- /dev/null +++ b/challenge-090/garrett-goebel/README @@ -0,0 +1 @@ +Solution by Garrett Goebel diff --git a/challenge-090/garrett-goebel/raku/ch-1.raku b/challenge-090/garrett-goebel/raku/ch-1.raku new file mode 100644 index 0000000000..00c9d0df57 --- /dev/null +++ b/challenge-090/garrett-goebel/raku/ch-1.raku @@ -0,0 +1,5 @@ +#!/usr/bin/env raku +'GTAAACCCCTTTTCATTTAGACAGATCGACTCCTTATCCATTCTCAGAGATGTGTTGCTGGTCGCCG'.&{ + say 'Nucleiobase count: ' ~ .comb.elems; + say 'Complementary sequence: ' ~ TR/TAGC/ATCG/; +} diff --git a/challenge-090/garrett-goebel/raku/ch-2.raku b/challenge-090/garrett-goebel/raku/ch-2.raku new file mode 100644 index 0000000000..dede70ec31 --- /dev/null +++ b/challenge-090/garrett-goebel/raku/ch-2.raku @@ -0,0 +1,19 @@ +#!/usr/bin/env raku + +unit sub MAIN ( + Int $A is copy where $A > 0 = 14, + Int $B is copy where $B > 0 = 12 +); + +my Int $r = 0; +my $format = "%10d & %10d | product: %10d\n"; +$format.printf($A,$B, $r); + +if ($A > 1) { + repeat { + $r += $B if $A mod 2; + $format.printf($A div= 2, $B *= 2, $r); + } while $A > 1; +} +$r += $B; +~(' ' x 24 ~ "| product: %10d\n").printf($r); |
