From 8ea664d24b04f1cf6497e047e960c055d09fa7db Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Tue, 26 May 2020 14:21:27 +0200 Subject: Comments. --- challenge-062/luca-ferrari/raku/ch-2.p6 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/challenge-062/luca-ferrari/raku/ch-2.p6 b/challenge-062/luca-ferrari/raku/ch-2.p6 index 7679e57f2c..c56a20c4ff 100644 --- a/challenge-062/luca-ferrari/raku/ch-2.p6 +++ b/challenge-062/luca-ferrari/raku/ch-2.p6 @@ -3,6 +3,8 @@ # Task 2 # N-queens +# Places the queen into the chessboard at the indicated coordinates. +# Also setto False every square the queen can reach. sub place-queen( @chessboard, $row, $column, $height, $dimension ){ for 0 ..^ $dimension { @@ -23,7 +25,9 @@ sub place-queen( @chessboard, $row, $column, $height, $dimension ){ } - +# +# Show every level of the chessboard. +# sub show-chessboard( @chessboard, $dimension ) { for 0 ..^ $dimension -> $height { say "Layer $height"; @@ -43,7 +47,6 @@ sub show-chessboard( @chessboard, $dimension ) { } sub MAIN( Int $dimension = 3 ){ - my $val = True; my @chessboard = [[True xx $dimension] xx $dimension] xx $dimension; for 0 ..^ $dimension -> $height { -- cgit