diff options
Diffstat (limited to '2022/Day1/part-two.cl')
| -rw-r--r-- | 2022/Day1/part-two.cl | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/2022/Day1/part-two.cl b/2022/Day1/part-two.cl deleted file mode 100644 index 2d88791..0000000 --- a/2022/Day1/part-two.cl +++ /dev/null @@ -1,21 +0,0 @@ -(defvar *prog-input*) - -(let ((ui (read-line))) - (if (equal ui "") - (setq *prog-input* *standard-input*) - (setq *prog-input* (open ui)))) - -(let - ((cal (read-line *prog-input* NIL)) (sums '(0))) - - (loop until (or (equal cal "end") (not cal)) do - (if (equal cal "") - (push 0 sums) - (push (+ (pop sums) (parse-integer cal)) sums)) - (setq cal (read-line *prog-input* NIL))) - - (setq sums (sort sums #'>)) - (print (+ (first sums) (second sums) (third sums)))) - -(if (not (eq *prog-input* *standard-input*)) - (close *prog-input*)) |
