diff options
| author | Syndamia <kamen@syndamia.com> | 2022-12-03 09:51:59 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2022-12-03 09:52:04 +0200 |
| commit | 3e79cce47623855ab2025c29154e828e2007adbf (patch) | |
| tree | d090b062ef104847c33ee58a907b21069ecb19ed | |
| parent | 39d5d4f3957971979cf65ad3fa505fb93274c2ee (diff) | |
| download | advent-of-code-3e79cce47623855ab2025c29154e828e2007adbf.tar advent-of-code-3e79cce47623855ab2025c29154e828e2007adbf.tar.gz advent-of-code-3e79cce47623855ab2025c29154e828e2007adbf.zip | |
[2022/template] Added comment explaining first line, changed cal to inpt, changed equals to string=
| -rw-r--r-- | 2022/template.cl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/2022/template.cl b/2022/template.cl index 9ffb4a0..285e5b5 100644 --- a/2022/template.cl +++ b/2022/template.cl @@ -1,15 +1,19 @@ (defvar *prog-input*) +;;; After running file, if you enter a blank line, code will work on each +;;; line of input, until "end" is typed. +;;; Otherwise, the input is taken as a filename and code will be executed +;;; over each line in the file until EOF. (let ((ui (read-line))) (if (equal ui "") (setq *prog-input* *standard-input*) (setq *prog-input* (open ui)))) (let - ((cal (read-line *prog-input* NIL)) ) + ((inpt (read-line *prog-input* NIL)) ) - (loop until (or (equal cal "end") (not cal)) do - (setq cal (read-line *prog-input* NIL))) + (loop until (or (string= inpt "end") (not inpt)) do + (setq inpt (read-line *prog-input* NIL))) (print 1)) |
