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
use v6; | |
my @board = 1..9; | |
my @winning-positions = [0..2], [3..5], [6..8], [0,3,6], [1,4,7], [2,5,8], | |
[0,4,8], [6,4,2]; | |
sub get-winner() { | |
for @winning-positions { | |
return (@board[$_][0], $_) if [eq] @board[$_]; | |
} |
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
use v6; | |
# the modexp-function from: http://rosettacode.org/wiki/Modular_exponentiation | |
sub modexp(Int $a is copy, Int $b is copy, $n) { | |
my $c = 1; | |
repeat while $b div= 2 { | |
($c *= $a) %= $n if $b % 2; | |
($a *= $a) %= $n; | |
} | |
$c; |
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
0 0 felher@win6074d [ ~/sources/perl6/rakudo_nom ] %> make spectest -j 10 | |
cd t/spec && git pull | |
remote: Counting objects: 539, done. | |
remote: Compressing objects: 100% (186/186), done. | |
remote: Total 402 (delta 296), reused 305 (delta 201) | |
Receiving objects: 100% (402/402), 47.99 KiB, done. | |
Resolving deltas: 100% (296/296), completed with 122 local objects. | |
From git://github.com/perl6/roast | |
4cfafd6..23a618d master -> origin/master | |
First, rewinding head to replay your work on top of it... |
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
From 68286f0c9998650eb33dbc5047ccfd294a0f0c9f Mon Sep 17 00:00:00 2001 | |
From: Felix Herrmann <[email protected]> | |
Date: Fri, 13 Apr 2012 20:38:52 +0200 | |
Subject: [PATCH] Make Exception.Bool return True | |
--- | |
src/core/Exception.pm | 2 -- | |
1 files changed, 0 insertions(+), 2 deletions(-) | |
diff --git a/src/core/Exception.pm b/src/core/Exception.pm |
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
From 394831b72d0004c1e2029bc143afa362a3d2a538 Mon Sep 17 00:00:00 2001 | |
From: Felix Herrmann <[email protected]> | |
Date: Sun, 15 Apr 2012 22:39:44 +0200 | |
Subject: [PATCH] add a few typed IO exceptions | |
--- | |
src/core/Exception.pm | 56 +++++++++++++++++++++++++++- | |
src/core/IO.pm | 97 +++++++++++++++++++++++++++++++++++++------------ | |
2 files changed, 128 insertions(+), 25 deletions(-) |
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
diff --git a/src/core/Exception.pm b/src/core/Exception.pm | |
index bab8e99..453613b 100644 | |
--- a/src/core/Exception.pm | |
+++ b/src/core/Exception.pm | |
@@ -156,6 +156,9 @@ my role X::OS { | |
} | |
my role X::IO does X::OS { }; | |
+my role X::IO::FileNotFound { | |
+ has $.file-not-found; |
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
From c309e19aa95f03939a3ca9b824cc2f7f435cb3bc Mon Sep 17 00:00:00 2001 | |
From: Felix Herrmann <[email protected]> | |
Date: Fri, 6 Jul 2012 13:39:13 +0200 | |
Subject: [PATCH] [Numeric] add coercion to Rat/Num/Int/Real | |
--- | |
lib/Numeric.pod | 30 ++++++++++++++++++++++++++++++ | |
1 files changed, 30 insertions(+), 0 deletions(-) | |
diff --git a/lib/Numeric.pod b/lib/Numeric.pod |
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
From d5436c373bf030d23111083a992f55f2b57b10cf Mon Sep 17 00:00:00 2001 | |
From: Felix Herrmann <[email protected]> | |
Date: Fri, 27 Jul 2012 13:29:26 +0200 | |
Subject: [PATCH] add Template::Mojo as a dependency of Bailador | |
--- | |
Makefile | 1 + | |
skel/tools/build/Makefile.in | 1 + | |
2 files changed, 2 insertions(+), 0 deletions(-) |
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
From fd9b8428a96d9fbbe8e19d9c89fffda6e7e15dd4 Mon Sep 17 00:00:00 2001 | |
From: Felix Herrmann <[email protected]> | |
Date: Mon, 30 Jul 2012 12:06:00 +0200 | |
Subject: [PATCH] make Main.pm output a usage message on an unexpected named | |
argument instead of bind failing | |
--- | |
src/core/Main.pm | 17 +++++++++++++++-- | |
1 files changed, 15 insertions(+), 2 deletions(-) |
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
From 6beffa8d2f4b18fcabd0c83a93310bc70a122ea3 Mon Sep 17 00:00:00 2001 | |
From: Felix Herrmann <[email protected]> | |
Date: Thu, 2 Aug 2012 20:07:03 +0200 | |
Subject: [PATCH] [Temporal] change constructor of Date to use default values | |
for year/month/day | |
--- | |
src/core/Temporal.pm | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) |
OlderNewer