Documentation
¶
Index ¶
- func Copy(program []int64) []int64
- func FromAscii(s string) []int64
- func ParseProgram(commaString string) ([]int64, error)
- func ReadProgram(filename string) ([]int64, error)
- func RunProgram(originalState []int64, reads []int64, debug bool) (state []int64, writes []int64, err error)
- func RunProgramChans(ctx context.Context, originalState []int64, reads <-chan int64, ...)
- func ToAscii(ints []int64) string
- type OpDef
- type OpFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseProgram ¶
ParseProgram parses an intcode program to a slice of ints.
func ReadProgram ¶
ReadProgram reads a file with a single intCode program.
func RunProgram ¶
func RunProgram(originalState []int64, reads []int64, debug bool) (state []int64, writes []int64, err error)
RunProgram runs an intcode program, modifying the state in place, and using slices for reads and writes.
func RunProgramChans ¶
func RunProgramChans(ctx context.Context, originalState []int64, reads <-chan int64, writes chan<- int64, errs chan<- error, updates <-chan [2]int64, debug bool, debugPrefix string)
RunProgramChans runs an intcode program, modifying the state in place, and using channels for input and output.
Types ¶
Click to show internal directories.
Click to hide internal directories.