day 12: fix minor issue
This commit is contained in:
parent
4b124189a0
commit
a612240e50
4
12.rkt
4
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)
|
||||
|
|
Loading…
Reference in New Issue