Documentation ¶
Overview ¶
Package matrix implements 2D matrix navigation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type XYNavigator ¶
type XYNavigator struct {
// contains filtered or unexported fields
}
func NewNavigator ¶
func NewNavigator(rows, cols int) (nav *XYNavigator, x, y int, inside bool)
func NewXYNavigator ¶
func NewXYNavigator(x, y int, boundary Rect) *XYNavigator
func (*XYNavigator) Down ¶
func (nav *XYNavigator) Down() (x, y int, inside bool)
Down returns next position below the current and wraps columns until reaching xj, yj.
func (*XYNavigator) Left ¶
func (nav *XYNavigator) Left() (x, y int, inside bool)
Left returns next position left of the current and wraps lines until reaching xi, yi.
func (*XYNavigator) Right ¶
func (nav *XYNavigator) Right() (x, y int, inside bool)
Right returns next position right of the current and wraps lines until reaching xj, yj.
func (*XYNavigator) Up ¶
func (nav *XYNavigator) Up() (x, y int, inside bool)
Up returns next position above the current and wraps columns until reaching xi, yi.
Click to show internal directories.
Click to hide internal directories.