Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add use v6 pragma to rosalind examples
- Loading branch information
Paul Cochrane
committed
Feb 28, 2015
1 parent
1edd74c
commit 1f15ddd
Showing
7 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| use v6; | ||
|
|
||
| my @dna = map { [.comb] }, lines; | ||
|
|
||
| my @c = @dna[0][]; | ||
|
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| use v6; | ||
|
|
||
| say get.comb.bag<A C G T>; | ||
|
|
||
| # vim: expandtab shiftwidth=4 ft=perl6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| use v6; | ||
|
|
||
| proto combine (Int, @) {*} | ||
| multi combine (0, @) { [] } | ||
| multi combine ($, []) { () } | ||
|
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| use v6; | ||
|
|
||
| my ($n, $k) = get.words; | ||
| my @fib := 1, 1, * * $k + * ... *; | ||
|
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| use v6; | ||
|
|
||
| my ($n, $m) = get.words; | ||
|
|
||
| my @population = 1, 0 xx ($m-1); | ||
|
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| use v6; | ||
|
|
||
| use NativeCall; | ||
| sub lcsq(Str $, Str $ --> Str) is native('./lcsq') {*} | ||
|
|
||
|
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| use v6; | ||
|
|
||
| my $rna = join '', grep /^ <[ACGU]>+ $/, lines; | ||
|
|
||
| say [*] map { [*] 1 .. $rna.comb(/$_/).elems }, <U C>; | ||
|
|
||