day21

package
v0.0.0-...-9c9a4a3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindEquality

func FindEquality(monkeys map[string]*Monkey, root, target string) int

Types

type Monkey

type Monkey struct {
	Name     string
	Value    int
	IsKnown  bool
	Operator string
	M1       string
	M2       string
	Parent   string
}

func (Monkey) Say

func (m Monkey) Say(monkeys map[string]*Monkey) int

type OpSeq

type OpSeq []OpValue

func (OpSeq) Reverse

func (ops OpSeq) Reverse(input int) int

type OpValue

type OpValue struct {
	Name     string
	Operator string
	Left     bool
	Value    int
}

type Parser

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

func NewParser

func NewParser(s Scanner) Parser

func (*Parser) Parse

func (p *Parser) Parse() map[string]*Monkey

type Scanner

type Scanner interface {
	Scan() bool
	Text() string
}

Jump to

Keyboard shortcuts

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