day20

package
v0.0.0-...-acf6961 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInput

func ParseInput(in [][]string) ([]Pixel, *Image, error)

func Part1

func Part1(algo []Pixel, img *Image) int

func Part2

func Part2(algo []Pixel, img *Image) int

Types

type Image

type Image struct {
	OrigW, OrigH int
	Growths      int
	Pixels       map[advent2021.XY]Pixel
}

func NewImage

func NewImage(in []string) (*Image, error)

func (*Image) Clone

func (i *Image) Clone() *Image

func (*Image) Enhance

func (i *Image) Enhance(algo []Pixel)

func (*Image) Index

func (i *Image) Index(pos advent2021.XY, alternateInfinite bool) int

func (*Image) LitPixels

func (i *Image) LitPixels() int

func (*Image) String

func (i *Image) String() string

type Pixel

type Pixel bool
const (
	Dark  Pixel = false
	Light       = true
)

func NewPixel

func NewPixel(c rune) (Pixel, error)

func (Pixel) String

func (p Pixel) String() string

Jump to

Keyboard shortcuts

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