day02_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: 3 Imported by: 0

Documentation

Overview

Package day02_2019 contains the solver for Advent of Code - Day 2: 1202 Program Alarm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Solver

type Solver struct {
	intcode.Memory
}

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

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. A copy of the opcodes slice is made before running the intcode program. Required to implement Solver.

func (*Solver) Part2

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

Part2 solves part 2 of the puzzle by brute-forcing every combination of nouns and verbs until finding the one that gives the correct answer. Required to implement Solver.

func (*Solver) ProcessInput

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

ProcessInput processes the input by transforming it into a slice of opcodes (ints) saved in the struct. Required to implement Solver.

Jump to

Keyboard shortcuts

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