commit 3e1cf6949b012f31e5b2d9ba569eae2ad5d9416f parent fc6bea7bbf24f1d0a79720a13dfa2871b15c2525 Author: mpizzzle <m@michaelpercival.xyz> Date: Thu, 3 Dec 2020 13:12:51 +0000 more tinkering Diffstat:
| M | 2020/puzzle_3.scm | | | 8 | ++------ |
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/2020/puzzle_3.scm b/2020/puzzle_3.scm @@ -11,11 +11,7 @@ (load "read_lines.scm") (define input (read-lines "files/3.txt" (lambda (x) x))) +(define slopes '((1 1) (3 1) (5 1) (7 1) (1 2))) (display (count-trees input 0 0 3 1)) (newline) - -(display (* (count-trees input 0 0 1 1) - (count-trees input 0 0 3 1) - (count-trees input 0 0 5 1) - (count-trees input 0 0 7 1) - (count-trees input 0 0 1 2))) (newline) +(display (apply * (map (lambda (x) (count-trees input 0 0 (car x) (car (cdr x)))) slopes))) (newline)