day5

package
v0.0.0-...-26478da Latest Latest
Warning

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

Go to latest
Published: Dec 12, 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 Almanac

type Almanac struct {
	SeedMaps      []*SeedMap
	SrcDstMapList []*SrcDstMap
	// contains filtered or unexported fields
}

func NewAlmanac

func NewAlmanac(input string) (*Almanac, error)

func (*Almanac) FindLowestLocationNumber

func (a *Almanac) FindLowestLocationNumber() int64

func (*Almanac) SrcDstMapListBySource

func (a *Almanac) SrcDstMapListBySource(source ItemName) []*SrcDstMap

type ItemName

type ItemName string
const FertilizerItem ItemName = "fertilizer"
const HumidityItem ItemName = "humidity"
const LightItem ItemName = "light"
const LocationItem ItemName = "location"
const SeedItem ItemName = "seed"
const SoilItem ItemName = "soil"
const TemperatureItem ItemName = "temperature"
const WaterItem ItemName = "water"

type SeedMap

type SeedMap struct {
	Seed        int64
	Soil        int64
	Fertilizer  int64
	Water       int64
	Light       int64
	Temperature int64
	Humidity    int64
	Location    int64
}

type SrcDstMap

type SrcDstMap struct {
	Source           ItemName
	Destination      ItemName
	SourceStart      int64
	DestinationStart int64
	Range            int64
}

func (*SrcDstMap) IsWithinDestinationRange

func (m *SrcDstMap) IsWithinDestinationRange(v int64) bool

func (*SrcDstMap) IsWithinSourceRange

func (m *SrcDstMap) IsWithinSourceRange(v int64) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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