Documentation ¶
Index ¶
- Constants
- func IsNice(line string) bool
- func IsNice2(line string) bool
- type Application
- func (app Application) Api(day int) string
- 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) Y2015D02()
- func (app *Application) Y2015D02P1()
- func (app *Application) Y2015D02P2()
- func (app *Application) Y2015D02_Summary() *utils.Summary
- func (app *Application) Y2015D03()
- func (app *Application) Y2015D03P1()
- func (app *Application) Y2015D03P2()
- func (app *Application) Y2015D03_Summary() *utils.Summary
- func (app *Application) Y2015D04()
- func (app *Application) Y2015D04P1()
- func (app *Application) Y2015D04P2()
- func (app *Application) Y2015D04_Summary() *utils.Summary
- func (app *Application) Y2015D05()
- func (app *Application) Y2015D05P1()
- func (app *Application) Y2015D05P2()
- func (app *Application) Y2015D05_Summary() *utils.Summary
- func (app *Application) Y2015D06()
- func (app *Application) Y2015D06P1()
- func (app *Application) Y2015D06P2()
- func (app *Application) Y2015D06_Summary() *utils.Summary
- func (app *Application) Y2015D07()
- func (app *Application) Y2015D07P1()
- func (app *Application) Y2015D07P2()
- func (app *Application) Y2015D07_Summary() *utils.Summary
- func (app *Application) Y2015D08()
- func (app *Application) Y2015D08P1()
- func (app *Application) Y2015D08P2_inprogress()
- func (app *Application) Y2015D08_Summary() *utils.Summary
- type Circuit
- type CircuitInstruction
- type Grid201503
- func (grid *Grid201503) East()
- func (grid *Grid201503) Increment(x int, y int)
- func (grid *Grid201503) North()
- func (grid *Grid201503) RoboEast()
- func (grid *Grid201503) RoboNorth()
- func (grid *Grid201503) RoboSouth()
- func (grid *Grid201503) RoboWest()
- func (grid *Grid201503) South()
- func (grid *Grid201503) West()
- type LightGrid
- func (grid *LightGrid) CountOnOff() (int, int)
- func (grid *LightGrid) Execute(instruction string)
- func (grid *LightGrid) ExecuteAll(instructions string)
- func (grid *LightGrid) Get(x int, y int) bool
- func (grid *LightGrid) ParseCoordinates(instruction string) (int, int, int, int)
- func (grid *LightGrid) Toggle(x int, y int)
- func (grid *LightGrid) TotalBrightness() int
- func (grid *LightGrid) TurnOff(x int, y int)
- func (grid *LightGrid) TurnOn(x int, y int)
- type Present
Constants ¶
const DAY_2015_02_DATA = `` /* 8111-byte string literal not displayed */
const DAY_2015_03_DATA = `` /* 8192-byte string literal not displayed */
const DAY_2015_05_DATA = `` /* 16999-byte string literal not displayed */
const DAY_2015_06_DATA = `` /* 9530-byte string literal not displayed */
const DAY_2015_07_DATA = `` /* 5302-byte string literal not displayed */
const DAY_2015_07_TEST_DATA = `123 -> x
456 -> y
x AND y -> d
x OR y -> e
x LSHIFT 2 -> f
y RSHIFT 2 -> g
NOT x -> h
NOT y -> i`
const DAY_2015_08_DATA = `` /* 6788-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
func NewApplication ¶
func NewApplication(cli *cli.CLI) Application
func (Application) Api ¶
func (app Application) Api(day int) string
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) Y2015D02P1 ¶
func (app *Application) Y2015D02P1()
func (*Application) Y2015D02P2 ¶
func (app *Application) Y2015D02P2()
--- Part Two --- The elves are also running low on ribbon. Ribbon is all the same width, so they only have to worry about the length they need to order, which they would again like to be exact.
The ribbon required to wrap a present is the shortest distance around its sides, or the smallest perimeter of any one face. Each present also requires a bow made out of ribbon as well; the feet of ribbon required for the perfect bow is equal to the cubic feet of volume of the present. Don't ask how they tie the bow, though; they'll never tell.
For example:
A present with dimensions 2x3x4 requires 2+2+3+3 = 10 feet of ribbon to wrap the present plus 2*3*4 = 24 feet of ribbon for the bow, for a total of 34 feet. A present with dimensions 1x1x10 requires 1+1+1+1 = 4 feet of ribbon to wrap the present plus 1*1*10 = 10 feet of ribbon for the bow, for a total of 14 feet. How many total feet of ribbon should they order?
func (*Application) Y2015D02_Summary ¶
func (app *Application) Y2015D02_Summary() *utils.Summary
func (*Application) Y2015D03P1 ¶
func (app *Application) Y2015D03P1()
func (*Application) Y2015D03P2 ¶
func (app *Application) Y2015D03P2()
func (*Application) Y2015D03_Summary ¶
func (app *Application) Y2015D03_Summary() *utils.Summary
func (*Application) Y2015D04P1 ¶
func (app *Application) Y2015D04P1()
func (*Application) Y2015D04P2 ¶
func (app *Application) Y2015D04P2()
func (*Application) Y2015D04_Summary ¶
func (app *Application) Y2015D04_Summary() *utils.Summary
func (*Application) Y2015D05P1 ¶
func (app *Application) Y2015D05P1()
func (*Application) Y2015D05P2 ¶
func (app *Application) Y2015D05P2()
func (*Application) Y2015D05_Summary ¶
func (app *Application) Y2015D05_Summary() *utils.Summary
func (*Application) Y2015D06P1 ¶
func (app *Application) Y2015D06P1()
func (*Application) Y2015D06P2 ¶
func (app *Application) Y2015D06P2()
You just finish implementing your winning light pattern when you realize you mistranslated Santa's message from Ancient Nordic Elvish.
The light grid you bought actually has individual brightness controls; each light can have a brightness of zero or more. The lights all start at zero.
The phrase turn on actually means that you should increase the brightness of those lights by 1.
The phrase turn off actually means that you should decrease the brightness of those lights by 1, to a minimum of zero.
The phrase toggle actually means that you should increase the brightness of those lights by 2.
What is the total brightness of all lights combined after following Santa's instructions?
For example:
turn on 0,0 through 0,0 would increase the total brightness by 1. toggle 0,0 through 999,999 would increase the total brightness by 2000000.
func (*Application) Y2015D06_Summary ¶
func (app *Application) Y2015D06_Summary() *utils.Summary
func (*Application) Y2015D07P1 ¶
func (app *Application) Y2015D07P1()
func (*Application) Y2015D07P2 ¶
func (app *Application) Y2015D07P2()
func (*Application) Y2015D07_Summary ¶
func (app *Application) Y2015D07_Summary() *utils.Summary
func (*Application) Y2015D08P1 ¶
func (app *Application) Y2015D08P1()
func (*Application) Y2015D08P2_inprogress ¶
func (app *Application) Y2015D08P2_inprogress()
func (*Application) Y2015D08_Summary ¶
func (app *Application) Y2015D08_Summary() *utils.Summary
type Circuit ¶
type Circuit struct {
// contains filtered or unexported fields
}
func NewCircuit ¶
func (*Circuit) GetInstruction ¶
func (c *Circuit) GetInstruction(key string) *CircuitInstruction
func (*Circuit) GetSignalValue ¶
type CircuitInstruction ¶
type CircuitInstruction struct {
// contains filtered or unexported fields
}
func NewCircuitInstruction ¶
func NewCircuitInstruction(line string) *CircuitInstruction
func (*CircuitInstruction) GetLeftRight ¶
func (i *CircuitInstruction) GetLeftRight() []string
type Grid201503 ¶
func NewGrid201503 ¶
func NewGrid201503() *Grid201503
func (*Grid201503) East ¶
func (grid *Grid201503) East()
func (*Grid201503) Increment ¶
func (grid *Grid201503) Increment(x int, y int)
func (*Grid201503) North ¶
func (grid *Grid201503) North()
func (*Grid201503) RoboEast ¶
func (grid *Grid201503) RoboEast()
func (*Grid201503) RoboNorth ¶
func (grid *Grid201503) RoboNorth()
func (*Grid201503) RoboSouth ¶
func (grid *Grid201503) RoboSouth()
func (*Grid201503) RoboWest ¶
func (grid *Grid201503) RoboWest()
func (*Grid201503) South ¶
func (grid *Grid201503) South()
func (*Grid201503) West ¶
func (grid *Grid201503) West()
type LightGrid ¶
type LightGrid struct {
// contains filtered or unexported fields
}
func NewLightGrid ¶
func NewLightGrid() *LightGrid