day11

package
v0.0.0-...-a84d436 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monkey

type Monkey struct {
	Items []big.Int

	InspectCount int
	// contains filtered or unexported fields
}

func NewMonkeyFromLines

func NewMonkeyFromLines(lines []string) Monkey
NewMonkeyFromLines takes line input to create a new Monkey , the structure looks like this example:

Starting items: 98, 97, 98, 55, 56, 72

Operation: new = old * 13
Test: divisible by 11
  If true: throw to monkey 4
  If false: throw to monkey 7

func (*Monkey) GetDivisor

func (m *Monkey) GetDivisor() int

func (*Monkey) InspectItems

func (m *Monkey) InspectItems(worryDivision bool) []Throw

InspectItems returns slice of Throw , indicating where to throw items.

type Throw

type Throw struct {
	Monkey int
	Item   big.Int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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