Solutions in Scala for the annual Advent of Code (adventofcode.com) challenge.
Note: this repo is not affiliated with Advent of Code.
See earlier editions:
The Scala Advent of Code website contains:
- some explanation of our solutions to Advent of Code
- more solutions from the community
We use Visual Studio Code with Metals to write Scala code, and Scala-CLI to compile and run it. (Scala-CLI has been the default scala command since Scala 3.5.)
You can follow these steps to set up your environement.
After you clone the repository, open a terminal and run:
$ cd scala-advent-of-code
$ scala setup-ide 2025
$ mkdir 2025/input
$ code 2025
code 2025 will open Visual Studio Code and start Metals. If not you may have to go to the Metals pane and click
the button labelled "Start Metals".
When you navigate to a file, e.g. 2025/src/day01.scala, Metals should index the project, and then display code lenses
above each of the main methods part1 and part2, as shown in this image:

To run a solution, first copy your input to the folder 2025/input.
Then click run in VS Code which will run the code and display the results of the program. Or debug,
which will let you pause on breakpoints, and execute expressions in the debug console.
To run a solution, first copy your input to the folder 2025/input.
In a terminal you can run:
$ scala 2025 -M day01.part1
Compiling project (Scala 3.x.y, JVM)
Compiled project (Scala 3.x.y, JVM)
The solution is 64929
Or, to run another solution:
$ scala 2025 -M <dayX>.<partX>
Please do not commit your puzzle inputs; we can not accept them, as they are protected by copyright