Data for Dataforce
This commit is contained in:
13
.aocbench.yaml
Normal file
13
.aocbench.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
version: 1
|
||||
author: "ctsk"
|
||||
language: "scala"
|
||||
dockerfile: "Dockerfile"
|
||||
code: "/code"
|
||||
workdir: "/code"
|
||||
runonce: "./mill aoc.assembly"
|
||||
cmd: "java -jar ./out/aoc/assembly.dest/out.jar %day% %input%"
|
||||
environment:
|
||||
- AOC_BENCH=1
|
||||
daypath: "aoc/dev/ctsk/aoc/Day%dayzero%.scala"
|
||||
inputfile: "data/%dayzero%.in"
|
||||
answerfile: "data/%dayzero%.out"
|
||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM eclipse-temurin:23-jdk-alpine
|
||||
|
||||
RUN apk add curl
|
||||
|
||||
COPY . /build
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN ./mill aoc.assembly
|
||||
26
aoc/src/dev/ctsk/aoc/Main.scala
Normal file
26
aoc/src/dev/ctsk/aoc/Main.scala
Normal file
@@ -0,0 +1,26 @@
|
||||
package dev.ctsk.aoc
|
||||
|
||||
import dev.ctsk.aoc.days._
|
||||
|
||||
val solvers = Map[Int, Solver](
|
||||
1 -> Day01,
|
||||
2 -> Day02,
|
||||
3 -> Day03
|
||||
)
|
||||
|
||||
|
||||
@main def main(day: String, input: String): Unit =
|
||||
solvers.get(day.toInt) match
|
||||
case Some(solver) =>
|
||||
val (timings, solution) = solver.run(input)
|
||||
sys.env.get("AOC_BENCH") match
|
||||
case Some(_) =>
|
||||
println(solution.p1)
|
||||
println(solution.p2)
|
||||
case None =>
|
||||
println(f"Preprocessing: ${timings.prep}%24s μs")
|
||||
println(f"Part 1: ${solution.p1}%15s ${timings.p1}%15s μs")
|
||||
println(f"Part 2: ${solution.p2}%15s ${timings.p2}%15s μs")
|
||||
|
||||
case None =>
|
||||
println(s"Day $day not solved")
|
||||
@@ -1,20 +0,0 @@
|
||||
package dev.ctsk.aoc
|
||||
|
||||
import dev.ctsk.aoc.days._
|
||||
|
||||
val solvers = Map[Int, Solver](
|
||||
1 -> Day01,
|
||||
2 -> Day02,
|
||||
3 -> Day03
|
||||
)
|
||||
|
||||
@main def main(day: String, input: String): Unit =
|
||||
solvers.get(day.toInt) match
|
||||
case Some(solver) =>
|
||||
val (timings, solution) = solver.run(input)
|
||||
println(f"Preprocessing: ${timings.prep}%24s μs")
|
||||
println(f"Part 1: ${solution.p1}%15s ${timings.p1}%15s μs")
|
||||
println(f"Part 2: ${solution.p2}%15s ${timings.p2}%15s μs")
|
||||
|
||||
case None =>
|
||||
println(s"Day $day not solved")
|
||||
2
data/01.ans
Normal file
2
data/01.ans
Normal file
@@ -0,0 +1,2 @@
|
||||
1223326
|
||||
21070419
|
||||
2
data/02.ans
Normal file
2
data/02.ans
Normal file
@@ -0,0 +1,2 @@
|
||||
559
|
||||
601
|
||||
2
data/03.ans
Normal file
2
data/03.ans
Normal file
@@ -0,0 +1,2 @@
|
||||
187833789
|
||||
94455185
|
||||
Reference in New Issue
Block a user