parent
f138918c2a
commit
796ff1a244
1 changed files with 17 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||||||
|
#+title: Solution to p5 |
||||||
|
|
||||||
|
First load the data as a list of cons cells (start . end) |
||||||
|
#+begin_src emacs-lisp :results none |
||||||
|
(with-temp-buffer |
||||||
|
(insert-file-contents "input-test") |
||||||
|
(advent/replace-multiple-regex-buffer |
||||||
|
'( |
||||||
|
("^\\([0-9]*\\)-\\([0-9]*\\)$" . "(\\1 . \\2)") |
||||||
|
("^$" . ") ids '("))) |
||||||
|
(goto-char (point-min)) |
||||||
|
(insert "(setq ranges '(") |
||||||
|
(goto-char (point-max)) |
||||||
|
(insert "))") |
||||||
|
(eval-buffer)) |
||||||
|
#+end_src |
||||||
|
|
||||||
Loading…
Reference in new issue