d8

Imports

Imports #

"bufio"
"fmt"
"io"
"log"
"runtime"
"strconv"
"strings"
"sync"
"advent2024/pkg/solver"
"advent2024/pkg/solver"
"context"
"fmt"
"io"
"strconv"

Constants & Variables

day var #

var day = "d8"

Structs

Coords struct #

type Coords struct {
x int
y int
}

LineIter struct #

type LineIter struct {
curr Coords
delta Coords
}

PuzzleStruct struct #

type PuzzleStruct struct {
field [][]byte
antennas map[byte][]Coords
}

PuzzleStructWithCtx struct #

type PuzzleStructWithCtx struct {
PuzzleStruct
}

Functions

Add function #

func Add(this Coords, other Coords) Coords

Eq function #

func Eq(this Coords, other Coords) bool

FindAntinodes function #

func FindAntinodes(this Coords, other Coords) [2]Coords

Init method #

func (p *PuzzleStruct) Init(reader io.Reader) error

InitCtx method #

func (p *PuzzleStructWithCtx) InitCtx(ctx context.Context, reader io.Reader) error

Invert function #

func Invert(this Coords) Coords

NewLineIter function #

func NewLineIter(this Coords, other Coords) LineIter

NewSolver function #

func NewSolver() *PuzzleStruct

NewSolverWithCtx function #

func NewSolverWithCtx() *PuzzleStructWithCtx

Next method #

func (i *LineIter) Next() (Coords, bool)

Solve method #

func (p *PuzzleStruct) Solve(part int) (string, error)

SolveCtx method #

func (p *PuzzleStructWithCtx) SolveCtx(ctx context.Context, part int) (string, error)

Sub function #

func Sub(this Coords, other Coords) Coords

findAntennas method #

func (p *PuzzleStruct) findAntennas()

inField method #

func (p *PuzzleStruct) inField(c Coords) bool

init function #

func init()

init function #

func init()

parseInput function #

func parseInput(sc *bufio.Scanner) (*[][]byte, error)

validateInput function #

func validateInput(field *[][]byte) error