day8

package
v0.0.0-...-552ec1b Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A

func A(input *advent.Input) (int, error)

func B

func B(input *advent.Input) (int, error)

Types

type DecryptedMessage

type DecryptedMessage [4]int

func (*DecryptedMessage) ToInt

func (m *DecryptedMessage) ToInt() int

type EncryptedMessage

type EncryptedMessage struct {
	Key     SegmentKey
	Message Message
}

func (*EncryptedMessage) Decrypt

func (s *EncryptedMessage) Decrypt() DecryptedMessage

type Message

type Message [4]SegmentPattern

Message contains the encrypted four segment patterns in the message.

type SegmentCipher

type SegmentCipher map[SegmentPattern]int

SegmentCipher is a map from encrypted segment patterns to their decrypted integer values.

func (*SegmentCipher) Decode

func (c *SegmentCipher) Decode(p SegmentPattern) int

func (*SegmentCipher) GetPattern

func (c *SegmentCipher) GetPattern(n int) SegmentPattern

type SegmentKey

type SegmentKey map[int][]SegmentPattern

SegmentKey contains all of the possible segment patterns 0-9. They are stored in a map, where the key is the pattern length.

func (*SegmentKey) GetCipher

func (p *SegmentKey) GetCipher() SegmentCipher

type SegmentPattern

type SegmentPattern mapset.Set

SegmentPattern is a set containing all of the runes that make up the signals which constitute a digit on a seven segment display

Jump to

Keyboard shortcuts

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