From 63744509d5a6696723ba7419e83c200c17827764 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Fri, 22 Dec 2017 16:56:58 +0100 Subject: [PATCH] Make most solutions work with make or shebang. --- 2017/day-01/Makefile | 1 + 2017/day-03/solution.clj | 1 + 2017/day-04/solution.awk | 1 + 2017/day-07/.gitignore | 1 + 2017/day-07/Makefile | 5 +++++ 2017/day-11/solution.scala | 1 + 2017/day-12/solution.js | 1 + 2017/day-13/solution.go | 1 + 2017/day-14/.gitignore | 1 + 2017/day-14/Makefile | 5 +++++ 2017/day-15/Makefile | 5 +++++ 2017/day-16/solution.groovy | 1 + 2017/day-21/solution.coffee | 1 + 13 files changed, 25 insertions(+) mode change 100644 => 100755 2017/day-03/solution.clj mode change 100644 => 100755 2017/day-04/solution.awk create mode 100644 2017/day-07/.gitignore create mode 100644 2017/day-07/Makefile mode change 100644 => 100755 2017/day-11/solution.scala mode change 100644 => 100755 2017/day-12/solution.js mode change 100644 => 100755 2017/day-13/solution.go create mode 100644 2017/day-14/.gitignore create mode 100644 2017/day-14/Makefile create mode 100644 2017/day-15/Makefile mode change 100644 => 100755 2017/day-16/solution.groovy mode change 100644 => 100755 2017/day-21/solution.coffee diff --git a/2017/day-01/Makefile b/2017/day-01/Makefile index 41ffd46..205240b 100644 --- a/2017/day-01/Makefile +++ b/2017/day-01/Makefile @@ -1,3 +1,4 @@ CXXFLAGS=-Wall -Wextra -pedantic -O3 -std=c++14 all: solution + ./$< diff --git a/2017/day-03/solution.clj b/2017/day-03/solution.clj old mode 100644 new mode 100755 index 351fb98..74ddaa1 --- a/2017/day-03/solution.clj +++ b/2017/day-03/solution.clj @@ -1,3 +1,4 @@ +#!/usr/bin/env clojure (defn lower_root [n] (int (Math/floor (Math/sqrt n)))) (defn box_size [n] ( diff --git a/2017/day-04/solution.awk b/2017/day-04/solution.awk old mode 100644 new mode 100755 index 6929ac6..f2a0a86 --- a/2017/day-04/solution.awk +++ b/2017/day-04/solution.awk @@ -1,3 +1,4 @@ +#!/usr/bin/awk -f function word2key(word, a, i, n, result) { n = split(word, a, "") diff --git a/2017/day-07/.gitignore b/2017/day-07/.gitignore new file mode 100644 index 0000000..83a0d9a --- /dev/null +++ b/2017/day-07/.gitignore @@ -0,0 +1 @@ +solution.exe diff --git a/2017/day-07/Makefile b/2017/day-07/Makefile new file mode 100644 index 0000000..0fe3b7f --- /dev/null +++ b/2017/day-07/Makefile @@ -0,0 +1,5 @@ +all: solution.exe + mono $< + +solution.exe: solution.cs + mcs $< -o $@ diff --git a/2017/day-11/solution.scala b/2017/day-11/solution.scala old mode 100644 new mode 100755 index cd715c0..e553535 --- a/2017/day-11/solution.scala +++ b/2017/day-11/solution.scala @@ -1,3 +1,4 @@ +#!/usr/bin/env scala import scala.io.StdIn object solution { diff --git a/2017/day-12/solution.js b/2017/day-12/solution.js old mode 100644 new mode 100755 index 4ed2724..28d58e6 --- a/2017/day-12/solution.js +++ b/2017/day-12/solution.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node const stdin = process.openStdin(); let content = ''; diff --git a/2017/day-13/solution.go b/2017/day-13/solution.go old mode 100644 new mode 100755 index 0042619..4d01c8f --- a/2017/day-13/solution.go +++ b/2017/day-13/solution.go @@ -1,3 +1,4 @@ +///usr/bin/env go run $0 $@ ; exit package main import "fmt" diff --git a/2017/day-14/.gitignore b/2017/day-14/.gitignore new file mode 100644 index 0000000..a4bd26d --- /dev/null +++ b/2017/day-14/.gitignore @@ -0,0 +1 @@ +solution diff --git a/2017/day-14/Makefile b/2017/day-14/Makefile new file mode 100644 index 0000000..4c727ec --- /dev/null +++ b/2017/day-14/Makefile @@ -0,0 +1,5 @@ +all: solution + ./$< + +solution: solution.rs + rustc $< -o $@ diff --git a/2017/day-15/Makefile b/2017/day-15/Makefile new file mode 100644 index 0000000..a933dc4 --- /dev/null +++ b/2017/day-15/Makefile @@ -0,0 +1,5 @@ +all: solution + ./$< + +solution: solution.hs + ghc $< -o $@ diff --git a/2017/day-16/solution.groovy b/2017/day-16/solution.groovy old mode 100644 new mode 100755 index 2160e99..3b29cdf --- a/2017/day-16/solution.groovy +++ b/2017/day-16/solution.groovy @@ -1,3 +1,4 @@ +#!/usr/bin/env groovy void doRotate(List list, String arg) { def amount = Integer.valueOf(arg.substring(1)) diff --git a/2017/day-21/solution.coffee b/2017/day-21/solution.coffee old mode 100644 new mode 100755 index 8ba03c1..ab85ea1 --- a/2017/day-21/solution.coffee +++ b/2017/day-21/solution.coffee @@ -1,3 +1,4 @@ +#!/usr/bin/env coffee String.prototype.count = (pattern) -> (this.match(pattern) || []).length