Intcode programs are comma separated lists of ints. To start, we load some code and read the input.
(load "~/code/advent/load.ss")
(advent-year 19)
(advent-day 5)
(define intcode
(parse-advent comma-separated))
Today, we give the machine an input value, run it to completion, and read its output signal.
(define (run-day5 intcode seed)
(let ((M (machine intcode 0)))
(M 'in seed)
(run-until-halt M)
(M 'out)))
Of course, the code/intcode.ss
file is setup so that there’s not
really anything to do here.
(7265618 . 7731427)