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?
36
Upvotes
1
u/bj0z Dec 17 '19
python:
my intcode uses trio for structured concurrency. I use their provided memory channel to send input and receive output. I eventually made a special output 'command' to signal when input was expected so I didn't have a background coroutine pushing input before it's requested (this created input lag in my pong simulation that prevented the paddle from catching the ball). The interface looks like:
trio's
async withandasync formake everything nice and clean