exercises

package
v0.0.0-...-e61498d Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TargetY = 2000000
	TestY   = 10
)

Functions

func IsReachableLocation

func IsReachableLocation(p image.Point, sensors []Sensor) bool

func ManhattanDistance

func ManhattanDistance(p1, p2 image.Point) int

Types

type Exercise

type Exercise struct {
	common.BaseExercise
}

Exercise for Advent of Code 2022 day 15

func (Exercise) One

func (c Exercise) One(instr string) (any, error)

One returns the answer to the first part of the exercise. wrong: 4807593 (too low) answer:

func (Exercise) Two

func (c Exercise) Two(instr string) (any, error)

Two returns the answer to the second part of the exercise. answer: 11747175442119

type Sensor

type Sensor struct {
	Location image.Point
	Beacon   image.Point
	Dist     int
}

Sensor is the X, Y coordinates of a sensor and the closest beacon with its distance.

Jump to

Keyboard shortcuts

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