day 12: fix minor issue

This commit is contained in:
xenia 2020-12-12 00:26:27 -05:00
parent 4b124189a0
commit a612240e50
1 changed files with 2 additions and 2 deletions

4
12.rkt
View File

@ -21,7 +21,7 @@
["L" (values (+ dir (d->r num)) x y)] ["L" (values (+ dir (d->r num)) x y)]
["R" (values (- dir (d->r num)) x y)] ["R" (values (- dir (d->r num)) x y)]
["F" (values dir (+ x (* num (cos dir))) (+ y (* num (sin dir))))]))) ["F" (values dir (+ x (* num (cos dir))) (+ y (* num (sin dir))))])))
(inexact->exact (floor (abs (+ x y))))) (inexact->exact (floor (+ (abs x) (abs y)))))
(define (part2 input) (define (part2 input)
(define (rot x y d) (define (rot x y d)
@ -44,7 +44,7 @@
(values sx sy nwx nwy)] (values sx sy nwx nwy)]
["F" ["F"
(values (+ sx (* num wx)) (+ sy (* num wy)) wx wy)]))) (values (+ sx (* num wx)) (+ sy (* num wy)) wx wy)])))
(inexact->exact (floor (abs (+ (abs sx) (abs sy)))))) (inexact->exact (floor (+ (abs sx) (abs sy)))))
(module+ test (module+ test
(require rackunit) (require rackunit)