1
1
# Scala Advent of Code 2023
2
2
3
- Solutions in Scala for the annual [ Advent of Code] ( https://adventofcode.com/ ) challenge. _ Note: this repo is not affiliated with Advent of Code. _
3
+ Solutions in Scala for the annual [ Advent of Code (adventofcode.com) ] ( https://adventofcode.com/ ) challenge.
4
4
5
- > See earlier editions:
6
- > - [ 2021] ( /2021/README.md )
7
- > - [ 2022] ( /2022/README.md )
5
+ _ Note: this repo is not affiliated with Advent of Code._
6
+
7
+ See earlier editions:
8
+
9
+ - [ 2021] ( /2021/README.md )
10
+ - [ 2022] ( /2022/README.md )
11
+ - [ 2023] ( /2023/README.md )
8
12
9
13
## Website
10
14
11
15
The [ Scala Advent of Code] ( https://scalacenter.github.io/scala-advent-of-code/ ) website contains:
12
- - some explanation of our solutions to [ Advent of Code (adventofcode.com)] ( https://adventofcode.com/ )
16
+
17
+ - some explanation of our solutions to [ Advent of Code] ( https://adventofcode.com/ )
13
18
- more solutions from the community
14
19
15
20
## Setup
@@ -23,39 +28,39 @@ You can follow these [steps](https://scalacenter.github.io/scala-advent-of-code/
23
28
After you clone the repository, open a terminal and run:
24
29
```
25
30
$ cd scala-advent-of-code
26
- $ scala-cli setup-ide 2023
27
- $ mkdir 2023 /input
28
- $ code 2023
31
+ $ scala-cli setup-ide 2024
32
+ $ mkdir 2024 /input
33
+ $ code 2024
29
34
```
30
35
31
- ` code 2023 ` will open Visual Studio Code and start Metals. If not you may have to go to the Metals pane and click
36
+ ` code 2024 ` will open Visual Studio Code and start Metals. If not you may have to go to the Metals pane and click
32
37
the button labelled "Start Metals".
33
38
34
- When you navigate to a file, e.g. ` 2023 /src/day01.scala` metals should index the project, and then display code lenses
39
+ When you navigate to a file, e.g. ` 2024 /src/day01.scala` metals should index the project, and then display code lenses
35
40
above each of the main methods ` part1 ` and ` part2 ` , as shown in this image:
36
41
![ ] ( img/code-lenses.png )
37
42
38
- To run a solution, first copy your input to the folder ` 2023 /input` .
43
+ To run a solution, first copy your input to the folder ` 2024 /input` .
39
44
Then click ` run ` in VS Code which will run the code and display the results of the program. Or ` debug ` ,
40
45
which will let you pause on breakpoints, and execute expressions in the debug console.
41
46
42
47
### How to run a solution with command line
43
48
49
+ To run a solution, first copy your input to the folder ` 2024/input ` .
50
+
44
51
In a terminal you can run:
45
52
```
46
- $ scala-cli 2023 -M day01.part1
53
+ $ scala-cli 2024 -M day01.part1
47
54
Compiling project (Scala 3.x.y, JVM)
48
55
Compiled project (Scala 3.x.y, JVM)
49
56
The solution is 64929
50
57
```
51
58
52
59
Or, to run another solution:
53
60
```
54
- $ scala-cli 2023 -M <dayX>.<partX>
61
+ $ scala-cli 2024 -M <dayX>.<partX>
55
62
```
56
63
57
- By default the solution programs run on our input files which are stored in the ` 2023/input ` folder.
58
- To get your solutions you can change the content of those files in the ` 2023/input ` folder.
59
-
60
64
## Contributing
65
+
61
66
- Please do not commit your puzzle inputs, we can not accept them as they are protected by copyright
0 commit comments