diff --git a/12.rkt b/12.rkt index 44482b3..dbff465 100644 --- a/12.rkt +++ b/12.rkt @@ -21,7 +21,7 @@ ["L" (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))))]))) - (inexact->exact (floor (abs (+ x y))))) + (inexact->exact (floor (+ (abs x) (abs y))))) (define (part2 input) (define (rot x y d) @@ -44,7 +44,7 @@ (values sx sy nwx nwy)] ["F" (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 (require rackunit)