Documentation ¶
Index ¶
- Constants
- type Application
- func (app Application) Api(day int) string
- func (app *Application) FuelRequired(mass int) int
- func (app *Application) FuelRequiredPart2(mass int) int
- func (app Application) GetMethod(methodName string) (reflect.Value, reflect.Value, bool)
- func (app Application) GetName() string
- func (app Application) GetPuzzle(year int, day int) utils.Puzzle
- func (app Application) Help(cli *cli.CLI)
- func (app Application) List() string
- func (app Application) Render(cli *cli.CLI)
- func (app Application) Run(cli *cli.CLI)
- func (app Application) Summary(year int, day int) *utils.Summary
- func (app *Application) Y2019D01()
- func (app *Application) Y2019D01P1()
- func (app *Application) Y2019D01P2()
- func (app *Application) Y2019D01_Summary() *utils.Summary
Constants ¶
const DAY_2019_01_DATA = `` /* 647-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
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) GetName ¶
func (app Application) GetName() string
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) 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