matrix

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Wall    = 1
	Empty   = 0
	Start   = 2
	End     = 3
	Path    = 4
	Invalid = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix struct {
	Rows, Cols int
	Data       [][]int
	Graph      graph.Graph[string, string]
	Start, End *Point
}

func NewMatrix

func NewMatrix(rows, cols int) *Matrix

NewMatrix creates a new matrix with the given number of rows and columns.

func (*Matrix) CleanAllValues

func (m *Matrix) CleanAllValues(v int)

func (*Matrix) FindMinimumPath

func (m *Matrix) FindMinimumPath() error

func (*Matrix) GenerateRandomWalls

func (m *Matrix) GenerateRandomWalls() error

func (*Matrix) Get

func (m *Matrix) Get(col, row int) int

func (*Matrix) InitEdges

func (m *Matrix) InitEdges() error

func (*Matrix) Set

func (m *Matrix) Set(col, row, val int)

Set sets the value at the given row and column.

type Point

type Point struct {
	X, Y int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL