diff options
author | Oscar Najera <hi@oscarnajera.com> | 2022-12-09 14:17:38 +0100 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2022-12-09 14:20:01 +0100 |
commit | f414e9a4a26d74402a569ddcb1ba964394267899 (patch) | |
tree | a477944de26ca35b26e27d14232882ced23d9d0d /AoC2022 | |
parent | 7e207bf01575550fcae82103d1e6573d7b7b5216 (diff) | |
download | scratch-f414e9a4a26d74402a569ddcb1ba964394267899.tar.gz scratch-f414e9a4a26d74402a569ddcb1ba964394267899.tar.bz2 scratch-f414e9a4a26d74402a569ddcb1ba964394267899.zip |
Unify advent of code makefile
now call from emacs compile
make -C .. <language>
Diffstat (limited to 'AoC2022')
-rw-r--r-- | AoC2022/01/makefile | 13 | ||||
-rw-r--r-- | AoC2022/02/makefile | 14 | ||||
-rw-r--r-- | AoC2022/03/makefile | 14 | ||||
-rw-r--r-- | AoC2022/04/makefile | 15 | ||||
-rw-r--r-- | AoC2022/05/makefile | 15 | ||||
-rw-r--r-- | AoC2022/06/makefile | 15 | ||||
-rw-r--r-- | AoC2022/07/makefile | 13 | ||||
-rw-r--r-- | AoC2022/08/solver.el | 3 | ||||
-rw-r--r-- | AoC2022/09/solver.el | 1 | ||||
-rw-r--r-- | AoC2022/makefile | 23 | ||||
-rw-r--r-- | AoC2022/readme.org | 8 |
11 files changed, 35 insertions, 99 deletions
diff --git a/AoC2022/01/makefile b/AoC2022/01/makefile deleted file mode 100644 index b885a31..0000000 --- a/AoC2022/01/makefile +++ /dev/null @@ -1,13 +0,0 @@ -## -# run solutions -# -# @file -# @version 0.1 - - - -# end - -run: - sbcl --load ~/.sbclrc --script solver.lisp - emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit diff --git a/AoC2022/02/makefile b/AoC2022/02/makefile deleted file mode 100644 index 630e630..0000000 --- a/AoC2022/02/makefile +++ /dev/null @@ -1,14 +0,0 @@ -## -# run solutions -# -# @file -# @version 0.1 - - - -# end - -run: - emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit - sbcl --load ~/.sbclrc --script solver.lisp - rustc solver.rs && ./solver diff --git a/AoC2022/03/makefile b/AoC2022/03/makefile deleted file mode 100644 index 630e630..0000000 --- a/AoC2022/03/makefile +++ /dev/null @@ -1,14 +0,0 @@ -## -# run solutions -# -# @file -# @version 0.1 - - - -# end - -run: - emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit - sbcl --load ~/.sbclrc --script solver.lisp - rustc solver.rs && ./solver diff --git a/AoC2022/04/makefile b/AoC2022/04/makefile deleted file mode 100644 index 6516fa4..0000000 --- a/AoC2022/04/makefile +++ /dev/null @@ -1,15 +0,0 @@ -## -# run solutions -# -# @file -# @version 0.1 - - - -# end - -run: - sbcl --load ~/.sbclrc --script solver.lisp - emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit - rustc solver.rs && ./solver - elixir solver.ex diff --git a/AoC2022/05/makefile b/AoC2022/05/makefile deleted file mode 100644 index fce871b..0000000 --- a/AoC2022/05/makefile +++ /dev/null @@ -1,15 +0,0 @@ -## -# run solutions -# -# @file -# @version 0.1 - - - -# end - -run: - sbcl --load ~/.sbclrc --script solver.lisp - emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit - # rustc solver.rs && ./solver - # elixir solver.ex diff --git a/AoC2022/06/makefile b/AoC2022/06/makefile deleted file mode 100644 index 3ddfc1a..0000000 --- a/AoC2022/06/makefile +++ /dev/null @@ -1,15 +0,0 @@ -## -# run solutions -# -# @file -# @version 0.1 - - - -# end - -run: - sbcl --load ~/.sbclrc --script solver.lisp - emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit - rustc solver.rs -o /tmp/solver && /tmp/solver - elixir solver.exs diff --git a/AoC2022/07/makefile b/AoC2022/07/makefile deleted file mode 100644 index 73929a6..0000000 --- a/AoC2022/07/makefile +++ /dev/null @@ -1,13 +0,0 @@ -## -# run solutions -# -# @file -# @version 0.1 - - - -# end - -run: - emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit - sbcl --load ~/.sbclrc --script solver.lisp diff --git a/AoC2022/08/solver.el b/AoC2022/08/solver.el index 27ee8a0..b3b0488 100644 --- a/AoC2022/08/solver.el +++ b/AoC2022/08/solver.el @@ -14,6 +14,9 @@ ;; Day 08 ;; ;;; Code: + +(require 'subr-x) + (cl-defstruct (forest (:constructor forest--create) (:copier nil)) "Contaner for the forest layout" diff --git a/AoC2022/09/solver.el b/AoC2022/09/solver.el index cf5ac7f..778c508 100644 --- a/AoC2022/09/solver.el +++ b/AoC2022/09/solver.el @@ -14,6 +14,7 @@ ;; Day 09 ;; ;;; Code: +(require 'subr-x) (defsubst solver-diff (head tail) (cons (- (car head) (car tail)) (- (cdr head) (cdr tail)))) diff --git a/AoC2022/makefile b/AoC2022/makefile new file mode 100644 index 0000000..968dbff --- /dev/null +++ b/AoC2022/makefile @@ -0,0 +1,23 @@ +## +# Project Title +# +# @file +# @version 0.1 + +clean: + find . -name solver | xargs rm -vf + + +emacs: ${PWD}/solver.el + cd ${PWD} && emacs -batch -l ert -l solver.el -f ert-run-tests-batch-and-exit + +lisp: ${PWD}/solver.lisp + cd ${PWD} && sbcl --load ~/.sbclrc --script solver.lisp + +rust: ${PWD}/solver.rs + cd ${PWD} && rustc solver.rs -o /tmp/solver && /tmp/solver + +elixir: ${PWD}/solver.exs + cd ${PWD} && elixir solver.exs + +# end diff --git a/AoC2022/readme.org b/AoC2022/readme.org new file mode 100644 index 0000000..ae155cb --- /dev/null +++ b/AoC2022/readme.org @@ -0,0 +1,8 @@ +#+title: Readme + +* Multi-language solutions for the 2022 Advent of code + +From any directory to execute the solutions call +#+begin_src bash +make -C .. <language> +#+end_src |