diff options
author | Andinus <andinus@nand.sh> | 2021-03-02 23:55:59 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-03-02 23:57:54 +0530 |
commit | edf8a7290888977ff0bc625f02a81abbc37fb984 (patch) | |
tree | ce9bf475eea0a423aff9852875413f4d89989581 /lib/Octans/Neighbors.rakumod | |
parent | b88fb075c4485154f72fb72354f8bf8004d71f72 (diff) | |
download | octans-edf8a7290888977ff0bc625f02a81abbc37fb984.tar.gz |
Re-structure code
These changes should make it easier to read the code.
Diffstat (limited to 'lib/Octans/Neighbors.rakumod')
-rw-r--r-- | lib/Octans/Neighbors.rakumod | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Octans/Neighbors.rakumod b/lib/Octans/Neighbors.rakumod index 33dd834..0c90b0c 100644 --- a/lib/Octans/Neighbors.rakumod +++ b/lib/Octans/Neighbors.rakumod @@ -34,13 +34,13 @@ sub neighbors ( # each direction according to the values specified in # @directions array. In this case we're just trying to # move in 4 directions (top, bottom, left & right). - DIRECTION: for @directions -> $direction { + direction: for @directions -> $direction { $pos-y = $y + $direction[0]; $pos-x = $x + $direction[1]; # If movement in this direction is out of puzzle grid # boundary then move on to next direction. - next DIRECTION unless @puzzle[$pos-y][$pos-x]; + next direction unless @puzzle[$pos-y][$pos-x]; # If neighbors exist in this direction then add them # to @neighbors[$y][$x] array. |