Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 994 Bytes

Day5

File metadata and controls

48 lines (34 loc) · 994 Bytes

Setup

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))

Operating

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.

Results

(7265618 . 7731427)