aboutsummaryrefslogtreecommitdiff
path: root/2024/10/puzzles.lisp
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-12-10 21:07:04 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-12-10 21:07:04 +0100
commitbcc82409e1ea44ccc5f662a05c8bb9f0daf3aade (patch)
tree13b6fb415c6561b9fd05b2c06efe180fdae07082 /2024/10/puzzles.lisp
parentd4e92440d680ae307b774c88f45dea34832e5c54 (diff)
Remove outer (let) and just use with =
Diffstat (limited to '2024/10/puzzles.lisp')
-rw-r--r--2024/10/puzzles.lisp12
1 files changed, 6 insertions, 6 deletions
diff --git a/2024/10/puzzles.lisp b/2024/10/puzzles.lisp
index a701c8d..dcfcc7c 100644
--- a/2024/10/puzzles.lisp
+++ b/2024/10/puzzles.lisp
@@ -1,12 +1,12 @@
#!/usr/bin/sbcl --script
(defun main (filename)
- (let ((lines (read-file-to-lines filename)))
- (loop with dimensions = (array-dimensions lines)
- for i from 0 below (first dimensions)
- summing (loop for j from 0 below (second dimensions)
- when (char= #\0 (aref lines i j))
- summing (score-for-trail-head lines i j)))))
+ (loop with lines = (read-file-to-lines filename)
+ with dimensions = (array-dimensions lines)
+ for i from 0 below (first dimensions)
+ summing (loop for j from 0 below (second dimensions)
+ when (char= #\0 (aref lines i j))
+ summing (score-for-trail-head lines i j))))
(defun read-file-to-lines (filename)
(with-open-file (stream filename)