Why Nostr? What is Njump?
2023-07-12 15:51:25

npub1hu…hhr7m on Nostr: Roast my CL solution for this baby level Advent of code challenge: (defun ...

Roast my CL solution for this baby level Advent of code challenge:

(defun get-input-file-list ()
(with-open-file (stream "1.1.input.txt")
(loop for line = (read-line stream nil)
while line
collect line)))

(defun max-calories(l max-cal cur-sum)
(let ((c (car l)))
(if c
(progn
(if (string-equal c "")
(progn
(setf max-cal (max cur-sum max-cal))
(setf cur-sum 0)
)
(setf cur-sum (+ cur-sum (parse-integer c)))
)
(max-calories (cdr l) max-cal cur-sum)
)
max-cal
)
)
)

(print (max-calories (get-input-file-list) 0 0))



https://adventofcode.com/2022/day/1
Author Public Key
npub1huv40mttns52dmge7m208v2xa6k6acdme8grweacvf8sczdj6rzs9hhr7m