Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twobiers/adventofcode_2020
Advent Of Code solutions written in Kotlin https://adventofcode.com/
https://github.com/twobiers/adventofcode_2020
advent-of-code advent-of-code-2020
Last synced: about 1 month ago
JSON representation
Advent Of Code solutions written in Kotlin https://adventofcode.com/
- Host: GitHub
- URL: https://github.com/twobiers/adventofcode_2020
- Owner: twobiers
- Created: 2020-12-02T07:52:35.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-12T08:06:54.000Z (almost 4 years ago)
- Last Synced: 2024-10-28T15:14:13.774Z (3 months ago)
- Topics: advent-of-code, advent-of-code-2020
- Language: Kotlin
- Homepage:
- Size: 273 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🎄 Advent Of Code 2020
**This repository contains my [Advent Of Code 2020](https://adventofcode.com/) solutions written in Kotlin**
Source: apolukhin/christmas-tree, Boost Software License 1.0## 🚀 Running
Run regular with:
```
gradle run
```The application takes a `--days` or `-d` arguments to determine which daily Task should be executed. It takes numbers concated with `,` within (1..25). For example: `--days 1,2,4,5` and with gradle run:
```
gradle run --args="-d 1,2,3,4,5"
```## 🧰 Parameters
```
Options:
--days, -d [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25] -> Days to execute as List e.g. 1,2,3,4 { String }
--repetitions, -r [2] -> Repetitions of solving the exercise. Kind of a benchmark warmup for the JIT Compiler { Int }
--help, -h -> Usage info
```![https://i.imgur.com/HbEeD3A.png](https://i.imgur.com/HbEeD3A.png)
## 🕑 Benchmarking
According to [Avoiding Benchmarking Pitfalls on the JVM](https://www.oracle.com/technical-resources/articles/java/architect-benchmarking.html) the measured elapsed time for the exercises is not meaningful. So a JMH Benchmark is included.
Run detailed benchmarks with (5 Warmups - 10 Iterations):
```
gradle benchmark
```To select a specific day for benchmark use the `include` Property which takes a regular expression. For example you can benchmark day 3 by
```
gradle benchmark -Pinclude=Day3
gradle benchmark -Pinclude=aoc.exercises.day3
```The benchmark will be printed to the console and exported as JSON to `build/reports/benchmarks/main`
![https://i.imgur.com/LA5Him8.png](https://i.imgur.com/LA5Him8.png)
# 🧙 Codegen
The project is able to create its file structure for each days exercise by running
```
gradle codegen -Pd=5
```
To get your personal input you need to set your SESSION Cookie as environment variable AOC_SESSION or put it inside a .env file at the root of the project.
Or you can skip obtaining the inputs by adding the `s` property
```
gradle codegen -Pd=5 -Ps
```And you can download the exercise textual description as readme with
```
gradle readme -Pd=5
```