intcode

package
v0.0.0-...-fcf7183 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Add paramater 1 and 2 and store it in 3
	Add opcode = iota + 1
	// Multiply paramater 1 and 2 and store it in 3
	Multiply
	// Input stored at parameter 1
	Input
	// Output the value of parameter 1
	Output
	// JumpTrue at parameter 2 if parameter 1 is non-zero
	JumpTrue
	// JumpFalse at parameter 2 if parameter 2 is zero
	JumpFalse
	// Less return 1 if parameter 1 is less than 2 else 0
	Less
	// Equals return 1 if parameter 1 is equal to 2 else 0
	Equals
	// Stop the program
	Stop = 99
)

OpCodes enumeration of operation code.

Variables

This section is empty.

Functions

func Compute

func Compute(instructions []int, maxOp opcode, inputs, outputs chan int)

Compute run a set instructions (also called program).

Types

This section is empty.

Jump to

Keyboard shortcuts

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