Package matrix implements iterator for matrix navigation
ยง Quick start
Use this package to minimize complexity when navigatin 2D matrix
structures. To loop over an matrix from top, left corner to bottom,
right
for nav, x, y, inside := NewNavigator(3, 3); inside; x, y, inside = nav.Right() {
// do something
}
Note that all navigation methods wrap at the edge of the given boundary.
0 1 2 3 4
-+---------+
0| | | | | |
1| |-|-|-| |
2| |-|>|x| |
3| |x|x|x| |
4| | | | | |
-+---------+