intcode

package
v0.0.0-...-973409f Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ModeImmediate = Mode(1)
View Source
const ModePosition = Mode(0)
View Source
const ModeRelative = Mode(2)

Variables

This section is empty.

Functions

func Run

func Run(mem *Memory, chIn chan int64, chOut chan int64, chDone chan int)

func RunAndRead

func RunAndRead(mem *Memory, input []int64) []int64

Types

type Memory

type Memory map[Value]Value

func CopyProgram

func CopyProgram(program Memory) Memory

func LoadProgram

func LoadProgram(input string) Memory

func (Memory) Get

func (m Memory) Get(i Value) Value

func (Memory) Set

func (m Memory) Set(i Value, value Value)

type Mode

type Mode = int8

type Op

type Op struct {
	Opcode int
	Mode1  Mode
	Mode2  Mode
	Mode3  Mode
}

type Value

type Value int64

Jump to

Keyboard shortcuts

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