d10

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_DATA = `` /* 974-byte string literal not displayed */
View Source
const TEST_DATA_01 = `noop
addx 3
addx -5`
View Source
const TEST_DATA_02 = `` /* 979-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU struct {
	RegisterX       int
	SignalStrengths []int
	Device          *Device
	TickNum         int
}

func NewCPU

func NewCPU(device *Device) *CPU

func (*CPU) Debug

func (c *CPU) Debug()

func (*CPU) ProcessInstruction

func (c *CPU) ProcessInstruction(instruction string)

func (*CPU) SignalStrength

func (c *CPU) SignalStrength()

func (*CPU) Tick

func (c *CPU) Tick()

type CRT

type CRT struct {
	Pixels map[string]string
	Rows   int
	Cols   int
	Device *Device
}

func NewCRT

func NewCRT(device *Device, rows int, cols int) *CRT

func (*CRT) Draw

func (c *CRT) Draw() string

func (*CRT) DrawSprite

func (c *CRT) DrawSprite() string

func (*CRT) Get

func (c *CRT) Get(row int, col int) string

func (*CRT) Put

func (c *CRT) Put(value string, row int, col int)

func (*CRT) Tick

func (c *CRT) Tick(tickNum int)

type Device

type Device struct {
	CPU          *CPU
	CRT          *CRT
	Instructions []string
	DEBUG        bool
}

func NewDevice

func NewDevice(input string, rows int, cols int) *Device

func (*Device) ProcessInstruction

func (d *Device) ProcessInstruction(instruction string)

func (*Device) ProcessInstructions

func (d *Device) ProcessInstructions()

type Puzzle

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

func NewPuzzle

func NewPuzzle() *Puzzle

func NewPuzzleWithData

func NewPuzzleWithData(input string) *Puzzle

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()

Jump to

Keyboard shortcuts

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