From 0cbe285d54f311fca4c035587233d981ec9b41fe Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Thu, 18 Sep 2025 14:44:55 -0400 Subject: [PATCH] Add char-at to library --- lib/lib-advent.org | 6 ++++++ 1 file changed, 6 insertions(+) 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