day_19

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Part1

func Part1()

func Part2

func Part2()

Types

type Blueprint

type Blueprint struct {
	ID    int
	Costs map[Resource]Cost
}

func (Blueprint) CanBuild

func (bp Blueprint) CanBuild(res Resource, with map[Resource]int) bool

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

type Cost

type Cost map[Resource]int

func (Cost) RankDesc

func (c Cost) RankDesc() []Resource

type Path

type Path struct {
	// contains filtered or unexported fields
}

func NewPath

func NewPath(ress ...Resource) *Path

func (*Path) Clone

func (p *Path) Clone() *Path

type Resource

type Resource int
const (
	None     Resource = 0
	Ore      Resource = 1
	Clay     Resource = 2
	Obsidian Resource = 3
	Geode    Resource = 4
)

func (Resource) Prev

func (r Resource) Prev() Resource

func (Resource) String

func (r Resource) String() string

type State

type State struct {
	// contains filtered or unexported fields
}

func NewState

func NewState() *State

func (*State) Build

func (s *State) Build(blueprint Blueprint, res Resource)

func (*State) Clone

func (s *State) Clone() *State

func (*State) Hash

func (s *State) Hash() string

func (*State) Mine

func (s *State) Mine()

type StateCache

type StateCache struct {
	// contains filtered or unexported fields
}

func NewStateCache

func NewStateCache() *StateCache

func (*StateCache) Add

func (c *StateCache) Add(state *State, max int)

func (*StateCache) Find

func (c *StateCache) Find(state *State) (int, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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