d5

package
v0.0.0-...-f50ab9b Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const REAL_INSTRUCTIONS = `` /* 9587-byte string literal not displayed */
View Source
const REAL_STACKS = `` /* 325-byte string literal not displayed */
View Source
const TEST_INSTRUCTIONS = `move 1 from 2 to 1
move 3 from 1 to 3
move 2 from 2 to 1
move 1 from 1 to 2`
View Source
const TEST_STACKS = `
    [D]    
[N] [C]    
[Z] [M] [P]
 1   2   3 
`

Variables

This section is empty.

Functions

This section is empty.

Types

type Puzzle

type Puzzle struct {
	Instructions []string
	Stacks       []*Stack
	// contains filtered or unexported fields
}

func NewPuzzle

func NewPuzzle(input string) *Puzzle

func NewPuzzleRealData

func NewPuzzleRealData() *Puzzle

func NewPuzzleTestData

func NewPuzzleTestData() *Puzzle

func (*Puzzle) AddStack

func (puzzle *Puzzle) AddStack(stack *Stack)

func (*Puzzle) Line

func (puzzle *Puzzle) Line() string

func (*Puzzle) Load

func (puzzle *Puzzle) Load(input string)

func (*Puzzle) Part1

func (puzzle *Puzzle) Part1()

func (*Puzzle) Part2

func (puzzle *Puzzle) Part2()

func (*Puzzle) Run

func (puzzle *Puzzle) Run()

func (*Puzzle) RunInstruction

func (puzzle *Puzzle) RunInstruction(instruction string)

func (*Puzzle) RunInstruction9001

func (puzzle *Puzzle) RunInstruction9001(instruction string)

func (*Puzzle) RunInstructions

func (puzzle *Puzzle) RunInstructions()

func (*Puzzle) RunInstructions9001

func (puzzle *Puzzle) RunInstructions9001()

type Stack

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

func NewStack

func NewStack() *Stack

func (*Stack) Flatten

func (s *Stack) Flatten() string

func (*Stack) Peek

func (s *Stack) Peek() string

func (*Stack) Pop

func (s *Stack) Pop() string

func (*Stack) Push

func (s *Stack) Push(entry string) *Stack

func (*Stack) Size

func (s *Stack) Size() int

Jump to

Keyboard shortcuts

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