d12

package
v0.0.0-...-3cf76cc Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SolvePart1

func SolvePart1(instructions []InstEntry) int

SolvePart1 ..

func SolvePart2

func SolvePart2(instructions []InstEntry) int

SolvePart2 ..

Types

type Boat

type Boat struct {
	X, Y      int
	Direction Direction
}

Boat ..

func (*Boat) Apply

func (b *Boat) Apply(ins Instruction, mag int) error

Apply ..

func (*Boat) ApplyFancyTurn

func (b *Boat) ApplyFancyTurn(mag int) error

ApplyFancyTurn ..

type Direction

type Direction int

Direction ..

func (Direction) Turn

func (d Direction) Turn(angle int) Direction

Turn ..

type InstEntry

type InstEntry struct {
	Instruction Instruction
	Magnitude   int
}

InstEntry ..

func ParseInput

func ParseInput(f []byte) ([]InstEntry, error)

ParseInput ..

type Instruction

type Instruction int

Instruction ..

Jump to

Keyboard shortcuts

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