aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-062/sangeet-kar/raku/ch-2.raku4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-062/sangeet-kar/raku/ch-2.raku b/challenge-062/sangeet-kar/raku/ch-2.raku
index 4a124254fb..3d973dab62 100755
--- a/challenge-062/sangeet-kar/raku/ch-2.raku
+++ b/challenge-062/sangeet-kar/raku/ch-2.raku
@@ -16,12 +16,11 @@ sub place-queen(@indices, @queens, @solutions) {
sub is-available($ref, $pos) {
- my ($refx, $refy, $refz) = $ref;
- my ($x, $y, $z) = $pos;
my $diff = ($ref »-« $pos)».abs.Set;
not (+$diff == 1 || (+$diff == 2 && 0 ∈ $diff))
}
+
sub indices-to-array(@indices, $n) {
my @array = [[[ 0 xx $n] xx $n] xx $n];
for @indices -> ($x, $y, $z) {
@@ -30,6 +29,7 @@ sub indices-to-array(@indices, $n) {
return @array;
}
+
sub MAIN (Int :$n=2) {
say n-queens-threeD $n;
}