day03

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser() *participle.Parser[Schematic]

Types

type Number

type Number struct {
	Value string `parser:"@Number"`
	Pos   lexer.Position
}

type Position

type Position struct {
	Line   int
	Column int
}

type Schematic

type Schematic struct {
	Numbers []*Number `parser:"( @@   "`
	Symbols []*Symbol `parser:"| @@ )*"`
}

func (*Schematic) Part1

func (schematic *Schematic) Part1() (result int)

func (*Schematic) Part2

func (schematic *Schematic) Part2() int

type Symbol

type Symbol struct {
	Value string `parser:"@Symbol"`
	Pos   lexer.Position
}

Jump to

Keyboard shortcuts

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