Initial commit
This commit is contained in:
commit
f242d2b0df
420 changed files with 62521 additions and 0 deletions
22
2019/day05/day05.rkt
Normal file
22
2019/day05/day05.rkt
Normal file
|
@ -0,0 +1,22 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "../intcode.rkt")
|
||||
|
||||
(module+ test
|
||||
(require rackunit))
|
||||
|
||||
(define (part1 filename)
|
||||
(define program (parse-file filename))
|
||||
(define vm (execute (start-machine program '(1))))
|
||||
(car (machine-outputs vm)))
|
||||
|
||||
(module+ test
|
||||
(check-equal? (part1 "input.txt") 12896948))
|
||||
|
||||
(define (part2 filename)
|
||||
(define program (parse-file filename))
|
||||
(define vm (execute (start-machine program '(5))))
|
||||
(car (machine-outputs vm)))
|
||||
|
||||
(module+ test
|
||||
(check-equal? (part2 "input.txt") 7704130))
|
Loading…
Add table
Add a link
Reference in a new issue