From f414e9a4a26d74402a569ddcb1ba964394267899 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Fri, 9 Dec 2022 14:17:38 +0100 Subject: Unify advent of code makefile now call from emacs compile make -C .. --- AoC2022/01/makefile | 13 ------------- AoC2022/02/makefile | 14 -------------- AoC2022/03/makefile | 14 -------------- AoC2022/04/makefile | 15 --------------- AoC2022/05/makefile | 15 --------------- AoC2022/06/makefile | 15 --------------- AoC2022/07/makefile | 13 ------------- AoC2022/08/solver.el | 3 +++ AoC2022/09/solver.el | 1 + AoC2022/makefile | 23 +++++++++++++++++++++++ AoC2022/readme.org | 8 ++++++++ 11 files changed, 35 insertions(+), 99 deletions(-) delete mode 100644 AoC2022/01/makefile delete mode 100644 AoC2022/02/makefile delete mode 100644 AoC2022/03/makefile delete mode 100644 AoC2022/04/makefile delete mode 100644 AoC2022/05/makefile delete mode 100644 AoC2022/06/makefile delete mode 100644 AoC2022/07/makefile create mode 100644 AoC2022/makefile create mode 100644 AoC2022/readme.org 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 .. +#+end_src -- cgit v1.2.3