You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,3 @@
1
-
<!--
2
-
* AUTOGENERATED -- DO NOT EDIT
3
-
* Edit static content in `priv/partials/readme_content.md`
4
-
* Run `mix gen_readme` to recreate
5
-
-->
6
1
# AdventOfCode
7
2
8
3
Advent of Code puzzle solutions in Elixir. It's work in progress and starting year 2015 to 2022, random days are attempted.
@@ -13,7 +8,7 @@ All solution modules reside in `lib/<year>/day_<day>.ex` and associated tests ha
13
8
14
9
## Stubs
15
10
16
-
To make the experience boilerplate-free and give all solutions uniform (more or less) structure, type `mix gen --year <year> --day <day>` or `mix gen <year> <day>` to have the structure and stub generated. Optionally, if you have `COOKIE` environment variable storing your cookie then it will download the input file and add the title on the moduledocs for you. Type `mix help gen` for more.
11
+
To make the experience boilerplate-free and give all solutions uniform (more or less) structure, type `mix gen --year <year> --day <day>` or `mix gen <year> <day>` to have the structure and stub generated. Optionally, if you have `AOC_SESSION_KEY` environment variable storing your cookie then it will download the input file and add the title on the moduledocs for you. Type `mix help gen` for more.
17
12
18
13
To solve the problem for a particular year/day, type in `mix solve --year <year> --day <day>` or `mix solve <year> <day>` and you will see the result of the mentioned `year/day` if it is valid and has been solved. Type `mix help solve` for more.
19
14
@@ -23,14 +18,24 @@ During December 1 of a new year (if Advent of Code is happening that year), the
23
18
24
19
* Create a new folder `XXXX` (in year format) under `/lib` or `/test`
25
20
* Update the `@latest_year` attribute on `advent_of_code.ex`
26
-
* Double check your session cookie (in case you're using it)
21
+
* Double check your session cookie `AOC_SESSION_KEY`(in case you're using it)
27
22
28
23
All commands should work from then on.
29
24
30
25
## Testing
31
26
32
27
run `mix test` to ensure all solutions are working okay. To run test for a particular year and day, type `mix test --only y<last-two-digits-of-year><zero-padded-day>`. For example: `mix test --only y1501` tests for `2015` as year and `1` as day.
33
28
29
+
## Benchmarking
30
+
31
+
To benchmark solutions and update the [Benchmarks](BENCHMARKS.md) report, use the provided script:
32
+
33
+
-`scripts/gen_benchmark.py`: Runs all solved problems across all years.
34
+
-`scripts/gen_benchmark.py <year>`: Benchmarks all days for a specific year.
35
+
-`scripts/gen_benchmark.py <year> <day>`: Benchmarks a single problem (useful after a new solve).
36
+
37
+
The script saves results to a persistent JSON file at `priv/data/benchmark.json`, allowing you to update specific results without re-running everything.
38
+
34
39
## Updating README and Stats
35
40
36
41
If you want to update the `README.md` (i.e. this file) please do not update `README.me` directly, instead update the static content (not stats related) on `priv/partials/readme_content.md` and then run `mix readme` to regenerate this file.
@@ -75,4 +80,3 @@ Note: All files mentioned above are autogenerated and are created by running `py
0 commit comments