day08_2019

package
v0.0.0-...-359cf57 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package day08_2019 contains the solver for Advent of Code - Day 8: Space Image Format

Index

Constants

View Source
const (
	WIDTH  = 25
	HEIGHT = 6
)

Variables

This section is empty.

Functions

func AsciiArt

func AsciiArt(r rune) rune

AsciiArt converts the rune pixel of an image (usually '0','1' or '2') into a character more suitable to be rendered as ascii art.

func MergePixels

func MergePixels(pixels ...rune) rune

MergePixels merges the pixels of a layer into a single one

func OccurrencesInLayer

func OccurrencesInLayer(layer string, pixel rune) int

OccurrencesInLayer counts how many of a given pixels are in a layer/image

Types

type Solver

type Solver struct {
	Layers []string
}

Solver implements the puzzle.Solver interface for the puzzle for day 8

func NewSolver

func NewSolver() *Solver

NewSolver returns a new solver

func (*Solver) Part1

func (s *Solver) Part1() (string, error)

Part1 solves part 1 of the puzzle. Required to implement Solver.

func (*Solver) Part2

func (s *Solver) Part2() (string, error)

Part2 solves part 2 of the puzzle. Required to implement Solver.

func (*Solver) ProcessInput

func (s *Solver) ProcessInput(fileContent string) error

ProcessInput processes the input. Required to implement Solver.

Jump to

Keyboard shortcuts

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