#+title: A collection of helper functions for Advent of Code #+property: header-args :results none * Input manipulation #+begin_src emacs-lisp (require 'dash) (defun advent/replace-multiple-regex-buffer (regex-list) "Takes REGEX-LIST as an alist ( regex . replacement ) and applies each substitiution to the current buffer" (save-excursion (-each regex-list (lambda (x) (goto-char (point-min)) (replace-regexp (car x) (cdr x)))))) #+end_src * Maze processing #+begin_src emacs-lisp (defun advent/split-string-into-char-list (str) "Split the string into a list of chars" (--map (string-to-char it) (split-string str "\\|.+" t))) #+end_src