computer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NOOP

func NOOP(x []int) []int

NOOP returns its input

func RunProgram

func RunProgram(fileName string, input chan int, preprocess func([]int) []int) (out chan int)

RunProgram runs a program, preprocessing it before executing.

Types

type Computer

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

Computer can run programs using IntCode defined in adventofcode.com/2019

func NewComputer

func NewComputer(program *[]int, input chan int) Computer

NewComputer instantiates a new computer object

func (*Computer) Execute

func (c *Computer) Execute()

Execute is a routine to execute a program until it halts

func (*Computer) GetOutput

func (c *Computer) GetOutput() chan int

GetOutput exposes the output channel for this computer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳