[lib] begin work on the lib

main
Jacopo De Simoi 9 months ago
parent 43c9d64318
commit 9d30ab98bf
  1. 22
      lib/lib-advent.org

@ -0,0 +1,22 @@
#+title: A collection of helper functions for Advent of Code
* inout manipulation
#+begin_src emacs-lisp :results none
(require 'dash)
(defun advent/replace-multiple-regex-buffer (regex-list)
"Takes REGEX-LIST as an alist ( regex . replacement )
and applies each substitiution
"
(insert-file-contents "input")
(goto-char (point-min))
(replace-regexp "\\([0-9]+\\),\\([0-9]+\\)" "(\\1 \\2)")
(goto-char (point-min))
(insert "(setq data '(")
(goto-char (point-max))
(insert "))")
(eval-buffer))
(setq width 71 ;71
height 71
start-pos '(0 0)
end-pos (list (- width 1) (- height 1)))
(setq full-data data)
#+end_src
Loading…
Cancel
Save