jps

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y int
}

func Find

func Find(obstacles [][]bool, start, goal Point) ([]Point, error)

Find returns a path from start to goal, or an error in following cases: - start or goal is outside the map - start or goal is inside an obstacle - there is no path from start to goal

func MustFind

func MustFind(obstacles [][]bool, start, goal Point) []Point

MustFind returns a path from start to goa. If start or goal is outside the map, it will try to find nearest point on the edge of the map. If start or goal is inside an obstacle, it will try to find nearest point on the edge of the obstacle. If there is no path from start to goal (or the new ones because of previous points) it will return path with just start point.

func TryFind

func TryFind(obstacles [][]bool, start, goal Point) ([]Point, error)

TryFind returns a path from start to goal, or an error in following cases: - start or goal is outside the map - there is no path from start to goal If start or goal is inside an obstacle, it will try to find nearest point on the edge of the obstacle.

Jump to

Keyboard shortcuts

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