(*)~changed to relative file naming
This commit is contained in:
@@ -16,7 +16,7 @@ out that Common Lisps semantics around parsing are kinda weird.
|
||||
To get input, use ~uiop:read-file-string~ (comes with ASDF,
|
||||
quicklisp, so in most common lisp systems).
|
||||
#+begin_src lisp
|
||||
(defvar input (uiop:read-file-string "2022/1-input"))
|
||||
(defvar input (uiop:read-file-string "1-input"))
|
||||
#+end_src
|
||||
|
||||
Each "bag" in the data is separated by two newlines, so let's define
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(defvar input (uiop:read-file-string "2022/1-input"))
|
||||
(defvar input (uiop:read-file-string "1-input"))
|
||||
|
||||
(defvar *sep (format nil "~%~%"))
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(defvar input (uiop:read-file-string "2022/2-input"))
|
||||
(defvar input (uiop:read-file-string "2-input"))
|
||||
;; Each newline represents a new round, which we should parse on the go
|
||||
|
||||
(defun sensible-convert-input (str)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(defvar input (uiop:read-file-string "2022/3-input"))
|
||||
(defvar input (uiop:read-file-string "3-input"))
|
||||
|
||||
(defun split-string-in-two (s)
|
||||
(let ((len (length s)))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
;; and since we're working with integers, it's simply checking if the
|
||||
;; bounds are included i.e. c in [a,b] and d in [a,b]
|
||||
|
||||
(defvar input (uiop:read-file-string "2022/4-input"))
|
||||
(defvar input (uiop:read-file-string "4-input"))
|
||||
|
||||
(defun parse-bound (str)
|
||||
"Given STR=\"a-b\" return (a b)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(defvar input (uiop:read-file-string "2022/5-input"))
|
||||
(defvar input (uiop:read-file-string "5-input"))
|
||||
|
||||
|
||||
;; When we get two newlines, it means the end of the initial state and
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(defvar input (with-input-from-string (s (uiop:read-file-string "2022/6-input"))
|
||||
(defvar input (with-input-from-string (s (uiop:read-file-string "6-input"))
|
||||
(read-line s nil)))
|
||||
|
||||
(defun is-unique (lst)
|
||||
|
||||
Reference in New Issue
Block a user