diff --git a/lib/lib-advent.org b/lib/lib-advent.org index 3ee51f1..62ce6af 100644 --- a/lib/lib-advent.org +++ b/lib/lib-advent.org @@ -20,6 +20,12 @@ (--map (string-to-char it) (split-string str "\\|.+" t))) #+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 (defun advent/coordinates-of (e li) "This takes a 2D list (a list of lists) of chars LI and an element E