astar

package
v0.0.0-...-09db940 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grid

type Grid struct {
	Rows   uint
	Cols   uint
	Walls  map[Node]bool
	Artist Painter
}

A Grid with a specific number of rows & columns

func (*Grid) AStarSearch

func (grid *Grid) AStarSearch(source, dest Node) []Node

AStarSearch performs the pathfinding from source to dest

type Node

type Node struct {
	R uint
	C uint
}

A Node struct denoting a location on the grid

type Painter

type Painter interface {
	Paint(node Node, cost uint, opened bool, closed bool)
}

Painter defines some GUI library that wishes to get updates on the changing nodes' status throughout the algorithm

Jump to

Keyboard shortcuts

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