See: https://adventofcode.com/2022
- SBT 1.8.0
- Scala 2.13
sbt clean test
Create an input in CalorieCounting.scala
object CalorieCountingInput {
val value ="""
|1000
|2000
|3000
|
|4000
|
|5000
|6000
|
|7000
|8000
|9000
|
|10000
|""".stripMargin
}
Evaluate Result in Main.scala
// Day 1
// Q1
print (
"CalorieCounting.getElfMostCalories:",
CalorieCounting.getElfMostCalories(Inputs.CalorieCountingInput)
)
// Q2
print(
"CalorieCounting.getTopNElvesMostCalories",
CalorieCounting.getTopNElvesMostCalories(Inputs.CalorieCountingInput, 3).map(_.totalCalories).sum
)
Run Main
sbt clean run