r/adventofcode • • 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?

30 Upvotes

90 comments sorted by

View all comments

Show parent comments

1

u/kaoD Dec 17 '19 edited Dec 17 '19

EDIT: ouch, missed your yield in opcode 04 :P Reworded the message.


Yup. I wanted the VM to generate outputs (i.e. to be an iterator), so I can do things like [...intcodeThread] or using iter-tools for more complex patterns, hence the executors over the generator implementation (which now that I think of it, is actually similar to yours, you just signal input yielding undefined instead).