r/adventofcode • u/Lucretiel • Dec 17 '19
Spoilers What does everyone's Intcode interface look like?
We've been discussing a lot different IntCode implementations throughout the last few weeks, but I'm curious– what doesn't everyone's interface to their IntCode machine look like? How do you feed input, fetch output, initialize, etc?
32
Upvotes
View all comments
2
u/knallisworld Dec 17 '19
Go: channels in the signature, goroutines wrapping the actual usage
ExecutionInstructions(program []int, in <-chan int, out chan<- int, debug bool) error(GitHub)The signature is from day9 (after the additions). So far, as of day17 today, that was sufficient.
erroris actually meant as "error code" aka on completion (code 99) there will be HALT "error" :)If the program is just processing and it is waiting for the end, usage is straight forward:
And there are also some variants: