day10

package
v0.0.0-...-9c9a4a3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 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 Direction

type Direction string

type Map

type Map struct {
	Nodes [][]*Node
	Start Position
	Rows  int
	Cols  int
}

func ParseMap

func ParseMap(s string) Map

func (*Map) BuildGraph

func (m *Map) BuildGraph()

func (*Map) Expand

func (m *Map) Expand() *Map

func (*Map) Farthest

func (m *Map) Farthest(p Position) int

func (*Map) Go

func (m *Map) Go(from *Node, dir Direction) *Node

func (*Map) Internals

func (m *Map) Internals() int

func (*Map) IsEdge

func (m *Map) IsEdge(r, c int) bool

func (*Map) LoopSize

func (m *Map) LoopSize(p Position) int

func (*Map) PrintMap

func (m *Map) PrintMap()

type Node

type Node struct {
	R           int
	C           int
	Connections map[Direction]*Node
	Value       string
	WayOut      bool
	Loop        bool
}

func (*Node) Print

func (n *Node) Print()

type Position

type Position struct {
	R int
	C int
}

type SearchStep

type SearchStep struct {
	Node     *Node
	Previous *Node
	LoopSize int
	Path     []*Node
}

type WayOutStep

type WayOutStep struct {
	Node    *Node
	Visited map[*Node]bool
}

Jump to

Keyboard shortcuts

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