diff options
Diffstat (limited to 'advent-of-code/2023/08/1.rkt')
| -rw-r--r-- | advent-of-code/2023/08/1.rkt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/advent-of-code/2023/08/1.rkt b/advent-of-code/2023/08/1.rkt index 3db9ccd..81424a1 100644 --- a/advent-of-code/2023/08/1.rkt +++ b/advent-of-code/2023/08/1.rkt @@ -34,14 +34,14 @@ (define (simulate start end) (let loop ((i 0) (cur start)) (if (string=? cur end) - i - (let () - (define instruction (next-instruction)) - (define mapping (hash-ref the-map cur)) - (define next - (if (char=? instruction #\L) - (car mapping) - (cadr mapping))) - (loop (+ 1 i) next))))) + i + (let () + (define instruction (next-instruction)) + (define mapping (hash-ref the-map cur)) + (define next + (if (char=? instruction #\L) + (car mapping) + (cadr mapping))) + (loop (+ 1 i) next))))) (simulate "AAA" "ZZZ")
\ No newline at end of file |
