Advent of Code 2024 in Scala 3
This is a normal sbt project. You can compile code with sbt compile
, run it with sbt run
, and sbt console
will start a Scala 3 REPL.
Each day is a separate sub-project which is generated by a scaffolding
project via sbt run <day number>
That results in a following structure:
.
├── README.md
└── src
└── main
├── resources
│ ├── input-test-p1.txt
│ ├── input-test-p2.txt
│ └── input.txt
└── scala
├── dX.scala
├── dXp1.scala
└── dXp2.scala
where X
is a number of the day.
input-test-p1.txt
contains test data for part 1
input-test-p2.txt
contains test data for part 2 (can be different from the part 1 test data)
input.txt
contains the real data for the day for both parts
dX.scala
is not expected to be modified and is used only to run the code for a day
sbt run test 1
will run dXp1.scala
against the input-test-p1.txt
data
sbt run test 2
will run dXp2.scala
against the input-test-p2.txt
data
sbt run main 1
will run dXp1.scala
against the input.txt
data
sbt run main 2
will run dXp2.scala
against the input.txt
data
sbt run
will run all of the commands above