aoc

package
v0.0.0-...-1bb50ad Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOOP int = iota
	ADDX
)
View Source
const (
	PACKET_INT  = "PACKET_INT"
	PACKET_LIST = "PACKET_LIST"
)
View Source
const (
	AIR = iota
	C_ROCK
	SAND
)
View Source
const (
	ROCK     = 1
	PAPER    = 2
	SCISSORS = 3
	VICTORY  = 6
	DRAW     = 3
	LOSE     = 0
)
View Source
const (
	RIGHT rune = 'R'
	LEFT  rune = 'L'
	DOWN  rune = 'D'
	UP    rune = 'U'
)

Variables

This section is empty.

Functions

func Abs

func Abs[T constraints.Integer](x T) T

func Compare

func Compare[C constraints.Ordered](a, b C) int

func IsRightOrder

func IsRightOrder(l PacketData, r PacketData) int

func Min

func Min(elems ...int) int

func Sort

func Sort[V any](a []V, f func(V, V) int)

func StringToInt

func StringToInt(str string) int

Types

type Cavern

type Cavern struct {
	Blocks map[string]int

	Floor int
	// contains filtered or unexported fields
}

func (*Cavern) DropSand

func (c *Cavern) DropSand() int

func (Cavern) GetBlock

func (c Cavern) GetBlock(x int, y int) int

func (Cavern) String

func (c Cavern) String() string

type ClockCircuit

type ClockCircuit struct {
	Cycle int
	// contains filtered or unexported fields
}

func NewClockCircuit

func NewClockCircuit() ClockCircuit

func (*ClockCircuit) AddInstruction

func (c *ClockCircuit) AddInstruction(i CpuInst)

func (ClockCircuit) EmptyIntruction

func (c ClockCircuit) EmptyIntruction() bool

func (ClockCircuit) PrintDisplay

func (c ClockCircuit) PrintDisplay() string

func (ClockCircuit) SignalStrength

func (c ClockCircuit) SignalStrength() int

func (ClockCircuit) String

func (c ClockCircuit) String() string

func (*ClockCircuit) Tick

func (c *ClockCircuit) Tick()

func (*ClockCircuit) WriteToDisplay

func (c *ClockCircuit) WriteToDisplay()

type CpuInst

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

type CrateMovement

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

type Elf

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

type File

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

func (*File) CalcSize

func (f *File) CalcSize() int

func (File) IsFile

func (f File) IsFile() bool

func (File) String

func (f File) String() string

type Game

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

type HeadMotion

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

type Input1

type Input1 []Elf

type Input10

type Input10 []CpuInst

type Input11

type Input11 KeepAway

type Input12

type Input12 SurroundingArea

type Input13

type Input13 []c.Pair[PacketData]

type Input14

type Input14 Cavern

type Input2

type Input2 [][]string

type Input3

type Input3 []rucksack

type Input4

type Input4 []assignment

type Input5

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

func (Input5) String

func (i Input5) String() string

type Input6

type Input6 []rune

type Input7

type Input7 *File

type Input8

type Input8 [][]int

func (Input8) ScenicScore

func (t Input8) ScenicScore(i int, j int) int

type Input9

type Input9 []HeadMotion

type Item

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

type KeepAway

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

func (KeepAway) MonkeyBusiness

func (ka KeepAway) MonkeyBusiness() int

func (KeepAway) String

func (ka KeepAway) String() string

func (*KeepAway) TakeRound

func (ka *KeepAway) TakeRound()

func (*KeepAway) TakeTurn

func (ka *KeepAway) TakeTurn(m *Monkey)

type Monkey

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

type PacketData

type PacketData interface {
	DataType() string
	String() string
}

func ParsePacketString

func ParsePacketString(str string, i int) (PacketData, int)

type PacketInt

type PacketInt struct {
	Data int
}

func (PacketInt) DataType

func (p PacketInt) DataType() string

func (PacketInt) String

func (p PacketInt) String() string

type PacketList

type PacketList struct {
	Data []PacketData
}

func (PacketList) DataType

func (p PacketList) DataType() string

func (PacketList) String

func (p PacketList) String() string

type Rope

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

func NewRope

func NewRope(knotsLength int) Rope

func (*Rope) MoveHead

func (r *Rope) MoveHead(motion HeadMotion)

func (*Rope) MoveKnot

func (r *Rope) MoveKnot(index int)

func (*Rope) RecordTail

func (r *Rope) RecordTail()

type Runner1

type Runner1 struct{}

func (Runner1) FmtInput

func (r Runner1) FmtInput(input string) Input1

func (Runner1) Run1

func (r Runner1) Run1(input Input1, _ bool) int

func (Runner1) Run2

func (r Runner1) Run2(input Input1, _ bool) int

type Runner10

type Runner10 struct{}

func (Runner10) FmtInput

func (r Runner10) FmtInput(input string) Input10

func (Runner10) Run1

func (r Runner10) Run1(input Input10, _ bool) int

func (Runner10) Run2

func (r Runner10) Run2(input Input10, _ bool) int

type Runner11

type Runner11 struct{}

func (Runner11) FmtInput

func (r Runner11) FmtInput(input string) Input11

func (Runner11) Run1

func (r Runner11) Run1(input Input11, _ bool) int

func (Runner11) Run2

func (r Runner11) Run2(input Input11, _ bool) int

type Runner12

type Runner12 struct{}

func (Runner12) FmtInput

func (r Runner12) FmtInput(input string) Input12

func (Runner12) Run1

func (r Runner12) Run1(input Input12, _ bool) int

func (Runner12) Run2

func (r Runner12) Run2(input Input12, _ bool) int

type Runner13

type Runner13 struct{}

func (Runner13) FmtInput

func (r Runner13) FmtInput(input string) Input13

func (Runner13) Run1

func (r Runner13) Run1(input Input13, _ bool) int

func (Runner13) Run2

func (r Runner13) Run2(input Input13, _ bool) int

type Runner14

type Runner14 struct{}

func (Runner14) FmtInput

func (r Runner14) FmtInput(input string) Input14

func (Runner14) Run1

func (r Runner14) Run1(input Input14, _ bool) int

func (Runner14) Run2

func (r Runner14) Run2(input Input14, _ bool) int

type Runner2

type Runner2 struct{}

func (Runner2) FmtInput

func (r Runner2) FmtInput(input string) Input2

func (Runner2) Run1

func (r Runner2) Run1(input Input2, _ bool) int

func (Runner2) Run2

func (r Runner2) Run2(input Input2, _ bool) int

type Runner3

type Runner3 struct{}

func (Runner3) FmtInput

func (r Runner3) FmtInput(input string) Input3

func (Runner3) Run1

func (r Runner3) Run1(input Input3, _ bool) int

func (Runner3) Run2

func (r Runner3) Run2(input Input3, _ bool) int

type Runner4

type Runner4 struct{}

func (Runner4) FmtInput

func (r Runner4) FmtInput(input string) Input4

func (Runner4) Run1

func (r Runner4) Run1(input Input4, _ bool) int

func (Runner4) Run2

func (r Runner4) Run2(input Input4, _ bool) int

type Runner5

type Runner5 struct{}

func (Runner5) FmtInput

func (r Runner5) FmtInput(input string) Input5

func (Runner5) Run1

func (r Runner5) Run1(input Input5, _ bool) int

func (Runner5) Run2

func (r Runner5) Run2(input Input5, _ bool) int

type Runner6

type Runner6 struct{}

func (Runner6) FmtInput

func (r Runner6) FmtInput(input string) Input6

func (Runner6) Run1

func (r Runner6) Run1(input Input6, _ bool) int

func (Runner6) Run2

func (r Runner6) Run2(input Input6, _ bool) int

type Runner7

type Runner7 struct{}

func (Runner7) FmtInput

func (r Runner7) FmtInput(input string) Input7

func (Runner7) Run1

func (r Runner7) Run1(input Input7, _ bool) int

func (Runner7) Run2

func (r Runner7) Run2(input Input7, _ bool) int

type Runner8

type Runner8 struct{}

func (Runner8) FmtInput

func (r Runner8) FmtInput(input string) Input8

func (Runner8) Run1

func (r Runner8) Run1(input Input8, _ bool) int

func (Runner8) Run2

func (r Runner8) Run2(input Input8, _ bool) int

type Runner9

type Runner9 struct{}

func (Runner9) FmtInput

func (r Runner9) FmtInput(input string) Input9

func (Runner9) Run1

func (r Runner9) Run1(input Input9, _ bool) int

func (Runner9) Run2

func (r Runner9) Run2(input Input9, _ bool) int

type SurroundingArea

type SurroundingArea 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