intcode

package
v0.0.0-...-3cb827e Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunIntCodeProgram

func RunIntCodeProgram(programInt []int, input chan int, output chan int, message chan Message)

RunIntCodeProgram runs an intcode program

func RunIntCodeProgramWaitForTermination

func RunIntCodeProgramWaitForTermination(program []int, input chan int, output chan int, t chan bool, message chan Message)

RunIntCodeProgramWaitForTermination runs an intcode program then sends a true signal to the t channel

Types

type Message

type Message struct {
	MessageType int
}

Message is used to signal whether the intcode computer is waiting for input or waiting for output We can use this to decide whether to send input or take output from the program MessageTypes are 0 for input, 1 for output

Jump to

Keyboard shortcuts

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