Add char-at to library

main
Jacopo De Simoi 6 months ago
parent f9a33045a6
commit 0cbe285d54
  1. 6
      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

Loading…
Cancel
Save