day3

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: 3 Imported by: 0

README

2023 Day 3

Learnings

  1. Regexp still saves the day

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	Lines        []string
	EngineParts  []EnginePart
	TotalSymbols int
}

func NewAnalyzer

func NewAnalyzer(lines []string) *Analyzer

func (*Analyzer) Calculate

func (a *Analyzer) Calculate() (int, error)

func (*Analyzer) EnginePartsNearPosition

func (a *Analyzer) EnginePartsNearPosition(row, col int) []EnginePart

func (*Analyzer) FindGearRatios

func (a *Analyzer) FindGearRatios(gearSymbol string, numAdj int) (int, error)

func (*Analyzer) Parse

func (a *Analyzer) Parse() error

type EnginePart

type EnginePart struct {
	Number   int
	Row      int
	ColStart int
	ColEnd   int
}

func (*EnginePart) IsNearPosition

func (p *EnginePart) IsNearPosition(row, col int) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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