day_08

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Part1

func Part1()

func Part2

func Part2()

Types

type Instruction

type Instruction interface{}

func ParseInstruction

func ParseInstruction(s string) (Instruction, error)

func ParseInstructions

func ParseInstructions(ins []string) ([]Instruction, error)

type RectInstruction

type RectInstruction struct {
	Width  int
	Height int
}

type RotateColInstruction

type RotateColInstruction struct {
	Col int
	By  int
}

type RotateRowInstruction

type RotateRowInstruction struct {
	Row int
	By  int
}

type Screen

type Screen struct {
	Rows []*ScreenRow
	// contains filtered or unexported fields
}

func NewScreen

func NewScreen(width, height int) *Screen

func (*Screen) Apply

func (s *Screen) Apply(is []Instruction)

func (*Screen) ApplyOne

func (s *Screen) ApplyOne(i Instruction)

func (*Screen) Get

func (s *Screen) Get(x, y int) bool

func (*Screen) Img

func (s *Screen) Img() string

func (*Screen) PixelsOn

func (s *Screen) PixelsOn() int

func (*Screen) SetGet

func (s *Screen) SetGet(x, y int, val bool) bool

type ScreenRow

type ScreenRow []bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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