util

package
v0.0.0-...-26478da Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_NOOP = "noop"
	CMD_ADDX = "addx"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CRT

type CRT struct {
	Cycle          int
	SpritePosition int
	Rows           string
}

func NewCRT

func NewCRT(startPosition int) *CRT

func (*CRT) Addx

func (crt *CRT) Addx(value int)

func (*CRT) Draw

func (crt *CRT) Draw()

func (*CRT) IsSpriteVisible

func (crt *CRT) IsSpriteVisible(drawPosition int) bool

func (*CRT) Noop

func (crt *CRT) Noop()

func (*CRT) Print

func (crt *CRT) Print() string

type Command

type Command struct {
	Name  string
	Value int
}

func NewCommand

func NewCommand(line string) *Command

type Register

type Register struct {
	Name      string
	Cycle     int
	V         int
	ValuesMap map[int]int
}

func NewRegister

func NewRegister(name string, startValue int) *Register

func (*Register) Addx

func (r *Register) Addx(value int)

func (*Register) GetValue

func (r *Register) GetValue() int

func (*Register) Noop

func (r *Register) Noop()

func (*Register) RecordCycle

func (r *Register) RecordCycle()

func (*Register) SumOfValuesAtCycles

func (r *Register) SumOfValuesAtCycles(cycles ...int) int

Jump to

Keyboard shortcuts

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