diff options
| author | Luca Ferrari <fluca1978@gmail.com> | 2020-05-26 14:21:27 +0200 |
|---|---|---|
| committer | Luca Ferrari <fluca1978@gmail.com> | 2020-05-26 14:21:27 +0200 |
| commit | 8ea664d24b04f1cf6497e047e960c055d09fa7db (patch) | |
| tree | fd5c08aed16266d0d6c5d375a04689105c551a17 | |
| parent | b1e1adc6bbcfbd5f1f22df772ea2ca97acb6de30 (diff) | |
| download | perlweeklychallenge-club-8ea664d24b04f1cf6497e047e960c055d09fa7db.tar.gz perlweeklychallenge-club-8ea664d24b04f1cf6497e047e960c055d09fa7db.tar.bz2 perlweeklychallenge-club-8ea664d24b04f1cf6497e047e960c055d09fa7db.zip | |
Comments.
| -rw-r--r-- | challenge-062/luca-ferrari/raku/ch-2.p6 | 7 |
1 files 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 { |
