--- Day 16: Reindeer Maze ---This is just the main search function that finds the score.This is the timing from i5. Banana is too slow for this (about 115 seconds).
Code:
(define (run seen from to dir) (cond ((equal? from to) '(0)) (else (let* ((nbrs (neighbors from dir)) (not-seen (filter (lambda (n) (not (member (cdr n) seen))) nbrs)) (new-seen (append (map cdr not-seen) seen)))(flatten (map (lambda (nbr) (inc (points (car nbr) dir) (run new-seen (cdr nbr) to (car nbr)))) not-seen))))))Code:
hrvoje@debi5:~/Projects/advent-of-code/advent-2024/day-16/Chez$ schemeChez Scheme Version 10.1.0Copyright 1984-2024 Cisco Systems, Inc.> (load "day16mx-new.ss")> (time (lambda () (day16 "input.txt")))(99488)#<time-duration 7.724532502>Statistics: Posted by hrvoje064 — Sun Feb 23, 2025 8:13 am