exercises

package
v0.0.0-...-e61498d Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals(n int) func(int) bool

func GreaterThan

func GreaterThan(n int) func(int) bool

func LessThan

func LessThan(n int) func(int) bool

Types

type Category

type Category int
const (
	ExtremlyCool Category = iota + 1
	Musical
	Aerodynamic
	Shiny
	Default
)

type Exercise

type Exercise struct {
	common.BaseExercise
}

Exercise for Advent of Code 2023 day 19.

func (Exercise) One

func (e Exercise) One(instr string) (any, error)

One returns the answer to the first part of the exercise. 260478 (too low)

func (Exercise) Two

func (e Exercise) Two(instr string) (any, error)

Two returns the answer to the second part of the exercise.

type Part

type Part struct {
	Rating map[Category]int
	Value  int
}

func (*Part) Process

func (p *Part) Process(w Workflows, flow string) Result

type PartRange

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

type PartTest

type PartTest struct {
	Category   Category
	Comparator rune
	Threshold  int
	Test       TestFunc
	Dest       string
}

type Result

type Result int
const (
	Accepted Result = iota + 1
	Rejected
)

type TestFunc

type TestFunc func(int) bool

type Workflow

type Workflow struct {
	Name  string
	Tests []*PartTest
}

type Workflows

type Workflows map[string]*Workflow

Jump to

Keyboard shortcuts

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