day3

package
v0.0.0-...-4d88bb0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateGearRatio

func CalculateGearRatio(engine *Engine) uint

Types

type Cell

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

func NewCell

func NewCell(char rune, row, col uint) *Cell

func (*Cell) IsDigit

func (c *Cell) IsDigit() bool

func (*Cell) IsPossibleGear

func (c *Cell) IsPossibleGear() bool

func (*Cell) IsSymbol

func (c *Cell) IsSymbol() bool

type CellKind

type CellKind int
const (
	OtherCellKind CellKind = iota
	GearCellKind
	DotCellKind
	NumericCellKind
)

type Engine

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

func NewEngine

func NewEngine() *Engine

func (*Engine) AddLine

func (e *Engine) AddLine(line string)

func (*Engine) AdjacentToSymbol

func (e *Engine) AdjacentToSymbol(num *Number) bool

func (*Engine) GetCell

func (e *Engine) GetCell(row, col int) *Cell

func (*Engine) NumberAt

func (e *Engine) NumberAt(row, col int) *uint

func (*Engine) Numbers

func (e *Engine) Numbers() ([]*Number, error)

func (*Engine) PossibleGears

func (e *Engine) PossibleGears() []*Cell

func (*Engine) RowLen

func (e *Engine) RowLen(row int) int

func (*Engine) SchemaLen

func (e *Engine) SchemaLen() int

type Gear

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

func NewGear

func NewGear() *Gear

type Number

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

func NewNumber

func NewNumber(val, row, start, end uint) *Number

func (*Number) AsUint

func (n *Number) AsUint() uint

Jump to

Keyboard shortcuts

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