diff options
Diffstat (limited to 'advent-of-code/2023/08/2.rkt')
| -rw-r--r-- | advent-of-code/2023/08/2.rkt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/advent-of-code/2023/08/2.rkt b/advent-of-code/2023/08/2.rkt index 35ca47a..c0c55ea 100644 --- a/advent-of-code/2023/08/2.rkt +++ b/advent-of-code/2023/08/2.rkt @@ -40,15 +40,15 @@ (define (simulate start) (let loop ((i 0) (cur start)) (if (is-end? cur) - i - (let () - (define instruction (next-instruction)) - (define (next-point point) - (define mapping (hash-ref the-map point)) - (if (char=? instruction #\L) - (car mapping) - (cadr mapping))) - (loop (+ 1 i) (next-point cur)))))) + i + (let () + (define instruction (next-instruction)) + (define (next-point point) + (define mapping (hash-ref the-map point)) + (if (char=? instruction #\L) + (car mapping) + (cadr mapping))) + (loop (+ 1 i) (next-point cur)))))) (define starts |
