Make most solutions work with make or shebang.

This commit is contained in:
2017-12-22 16:56:58 +01:00
parent 2a35384c76
commit 63744509d5
13 changed files with 25 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
CXXFLAGS=-Wall -Wextra -pedantic -O3 -std=c++14 CXXFLAGS=-Wall -Wextra -pedantic -O3 -std=c++14
all: solution all: solution
./$<

1
2017/day-03/solution.clj Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env clojure
(defn lower_root [n] (int (Math/floor (Math/sqrt n)))) (defn lower_root [n] (int (Math/floor (Math/sqrt n))))
(defn box_size [n] ( (defn box_size [n] (

1
2017/day-04/solution.awk Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/awk -f
function word2key(word, a, i, n, result) function word2key(word, a, i, n, result)
{ {
n = split(word, a, "") n = split(word, a, "")

1
2017/day-07/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
solution.exe

5
2017/day-07/Makefile Normal file
View File

@@ -0,0 +1,5 @@
all: solution.exe
mono $<
solution.exe: solution.cs
mcs $< -o $@

1
2017/day-11/solution.scala Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env scala
import scala.io.StdIn import scala.io.StdIn
object solution { object solution {

1
2017/day-12/solution.js Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env node
const stdin = process.openStdin(); const stdin = process.openStdin();
let content = ''; let content = '';

1
2017/day-13/solution.go Normal file → Executable file
View File

@@ -1,3 +1,4 @@
///usr/bin/env go run $0 $@ ; exit
package main package main
import "fmt" import "fmt"

1
2017/day-14/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
solution

5
2017/day-14/Makefile Normal file
View File

@@ -0,0 +1,5 @@
all: solution
./$<
solution: solution.rs
rustc $< -o $@

5
2017/day-15/Makefile Normal file
View File

@@ -0,0 +1,5 @@
all: solution
./$<
solution: solution.hs
ghc $< -o $@

1
2017/day-16/solution.groovy Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env groovy
void doRotate(List<String> list, String arg) { void doRotate(List<String> list, String arg) {
def amount = Integer.valueOf(arg.substring(1)) def amount = Integer.valueOf(arg.substring(1))

1
2017/day-21/solution.coffee Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env coffee
String.prototype.count = (pattern) -> String.prototype.count = (pattern) ->
(this.match(pattern) || []).length (this.match(pattern) || []).length