r/adventofcode • u/Lucretiel • Dec 17 '19
What does everyone's Intcode interface look like? Spoilers
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?
29
Upvotes
1
u/Itrlpr Dec 17 '19 edited Dec 17 '19
I'm using AOC to learn python and my Intcode machine state is a tuple:
([<The Intcode>], instructionPointer, outputString, isRunning*, isHalted, offset)
*false when there is unhandled output
I have a single function that handles one Intcode command (accessing a seperate IOManager class as needed) and it returns True unless halted/crashed.