aoc2019

package
v0.0.0-...-f50ab9b Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DAY_2019_01_DATA = `` /* 647-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	CLI     *cli.CLI
	Verbose bool
}

func NewApplication

func NewApplication(cli *cli.CLI) Application

func (Application) Api

func (app Application) Api(day int) string

func (*Application) FuelRequired

func (app *Application) FuelRequired(mass int) int

For a mass of 12, divide by 3 and round down to get 4, then subtract 2 to get 2. For a mass of 14, dividing by 3 and rounding down still yields 4, so the fuel required is also 2. For a mass of 1969, the fuel required is 654. For a mass of 100756, the fuel required is 33583.

Fuel required to launch a given module is based on its mass. Specifically, to find the fuel required for a module, take its mass, divide by three, round down, and subtract 2.

func (*Application) FuelRequiredPart2

func (app *Application) FuelRequiredPart2(mass int) int

func (Application) GetMethod

func (app Application) GetMethod(methodName string) (reflect.Value, reflect.Value, bool)

func (Application) GetName

func (app Application) GetName() string

func (Application) GetPuzzle

func (app Application) GetPuzzle(year int, day int) utils.Puzzle

func (Application) Help

func (app Application) Help(cli *cli.CLI)

func (Application) List

func (app Application) List() string

func (Application) Render

func (app Application) Render(cli *cli.CLI)

func (Application) Run

func (app Application) Run(cli *cli.CLI)

func (Application) Summary

func (app Application) Summary(year int, day int) *utils.Summary

func (*Application) Y2019D01

func (app *Application) Y2019D01()

this is what we will reflect and call - so both parts with run. It's up to you to make it print nicely etc. The app reference has a CLI for logging.

func (*Application) Y2019D01P1

func (app *Application) Y2019D01P1()

rename this to the year and day in question

func (*Application) Y2019D01P2

func (app *Application) Y2019D01P2()

rename this to the year and day in question

func (*Application) Y2019D01_Summary

func (app *Application) Y2019D01_Summary() *utils.Summary

Jump to

Keyboard shortcuts

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