aocdroid

package
v0.0.0-...-5094afa Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Directions = []Point{
		{X: 0, Y: -1},
		{X: 0, Y: 1},
		{X: -1, Y: 0},
		{X: 1, Y: 0}}
	DirNorth = 0
	DirSouth = 1
	DirWest  = 2
	DirEast  = 3
)

Functions

func BFS

func BFS()

func DFS

func DFS(current *Droid,
	handle func(current *Droid, visited *Droid, pos Point, distance float64) bool,
	movement *big.Int, visited *Droid, pos Point, distance float64)

Types

type Droid

type Droid struct {
	Grid map[Point]*big.Int
	Pos  Point
}

func New

func New(prog aocintcode.Program) (droid Droid, inputs chan *big.Int, outputs chan *big.Int)

func (*Droid) Add

func (d *Droid) Add(p Point, val *big.Int)

func (*Droid) Display

func (d *Droid) Display(char func(state *Droid, x, y int64, tile *big.Int, empty bool) string)

func (*Droid) Print

func (d *Droid) Print(char func(state *Droid, x, y int64, tile *big.Int, empty bool) string)

type Point

type Point struct{ X, Y int64 }

func (*Point) Add

func (p *Point) Add(p2 Point) Point

Jump to

Keyboard shortcuts

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