|
|
|
@ -20,6 +20,12 @@ |
|
|
|
(--map (string-to-char it) (split-string str "\\|.+" t))) |
|
|
|
(--map (string-to-char it) (split-string str "\\|.+" t))) |
|
|
|
#+end_src |
|
|
|
#+end_src |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
|
|
|
(defun advent/char-at (p l) |
|
|
|
|
|
|
|
"return the char at position P in the 2D list l" |
|
|
|
|
|
|
|
(nth (car p) (nth (cadr p) l))) |
|
|
|
|
|
|
|
#+end_src |
|
|
|
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(defun advent/coordinates-of (e li) |
|
|
|
(defun advent/coordinates-of (e li) |
|
|
|
"This takes a 2D list (a list of lists) of chars LI and an element E |
|
|
|
"This takes a 2D list (a list of lists) of chars LI and an element E |
|
|
|
|