day_02

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Part1

func Part1()

func Part2

func Part2()

Types

type Command

type Command interface{}

func ParseCommand

func ParseCommand(s string) (Command, error)

type DownCommand

type DownCommand struct {
	// contains filtered or unexported fields
}

type ForwardCommand

type ForwardCommand struct {
	// contains filtered or unexported fields
}

type Position2D

type Position2D struct {
	X     int
	Depth int
	Aim   int
}

func AppliedCommand

func AppliedCommand(cmd Command, pos Position2D) Position2D

func AppliedCommandAim

func AppliedCommandAim(cmd Command, pos Position2D) Position2D

func ProcessInput

func ProcessInput(in string, pos Position2D, appFunc func(cmd Command, pos Position2D) Position2D) (Position2D, error)

type UpCommand

type UpCommand struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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