- (destructuring-bind (rise run) slope
- (loop with terrain-width = (-> tree-map first length)
- for i upfrom 0 by run
- for j upfrom 0
- for terrain-line in tree-map
- when (->> rise (mod j) (= 0))
- counting (->> terrain-width
- (mod i)
- (char terrain-line)
- (char= #\#)))))
+ (loop with (rise run) = slope
+ with proper-map = (loop for j upfrom 0
+ for line in tree-map
+ when (->> rise (mod j) (= 0))
+ collecting line)
+ with terrain-width = (-> tree-map first length)
+ for i upfrom 0 by run
+ for terrain-line in proper-map
+ counting (->> terrain-width
+ (mod i)
+ (char terrain-line)
+ (char= #\#))))