Skip to content

Commit 67fc2ed

Browse files
authored
Project re-organization. (#1)
1 parent 742fb73 commit 67fc2ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1927
-1259
lines changed

.circleci/config.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: 2.1
2+
jobs:
3+
test:
4+
resource_class: small
5+
docker:
6+
- image: cimg/openjdk:17.0
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
keys:
11+
- gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
12+
- gradle-cache-{{ checksum "build.gradle.kts" }}
13+
- run:
14+
name: Static analyzer
15+
command: ./gradlew detekt
16+
- run:
17+
name: Running tests
18+
command: ./gradlew test
19+
- save_cache:
20+
key: gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
21+
paths:
22+
- ~/.gradle/wrapper
23+
- save_cache:
24+
key: gradle-cache-{{ checksum "build.gradle.kts" }}
25+
paths:
26+
- ~/.gradle/caches
27+
- store_test_results:
28+
path: build/test-results/test
29+
- store_artifacts:
30+
path: build/reports/tests/test
31+
destination: coverage-test
32+
33+
workflows:
34+
"Build and test":
35+
jobs:
36+
- test

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.gradle
22
.idea
33
build
4-
src/**/*.txt

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
# advent-of-code-22-kotlin
1+
# Advent of Code 2022 in Kotlin
22

3-
Welcome to the Advent of Code[^aoc] Kotlin project created by [lakiboy][github] using the [Advent of Code Kotlin Template][template] delivered by JetBrains.
3+
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/lakiboy/advent-of-code-22-kotlin/tree/reorganization.svg?style=svg&circle-token=0104223da0789fd7cbd9f2a2d030f91c76845550)](https://dl.circleci.com/status-badge/redirect/gh/lakiboy/advent-of-code-22-kotlin/tree/reorganization)
44

5-
In this repository, lakiboy is about to provide solutions for the puzzles using [Kotlin][kotlin] language.
5+
My solutions (WIP) for the [Advent of Code 2022](https://adventofcode.com/2022) puzzles in [Kotlin](https://kotlinlang.org).
66

7-
If you're stuck with Kotlin-specific questions or anything related to this template, check out the following resources:
7+
The ultimate goal:
88

9-
- [Kotlin docs][docs]
10-
- [Kotlin Slack][slack]
11-
- Template [issue tracker][issues]
9+
- to play around with Kotlin and improve [Standard library](https://kotlinlang.org/api/latest/jvm/stdlib/) knowledge;
10+
- to revisit some algorithms and stay in shape;
11+
- to play around with [benchmarking](https://github.com/Kotlin/kotlinx-benchmark);
12+
- and most importantly to have fun.
1213

14+
## Puzzles
1315

14-
[^aoc]:
15-
[Advent of Code][aoc] – An annual event of Christmas-oriented programming challenges started December 2015.
16-
Every year since then, beginning on the first day of December, a programming puzzle is published every day for twenty-five days.
17-
You can solve the puzzle and provide an answer using the language of your choice.
18-
19-
[aoc]: https://adventofcode.com
20-
[docs]: https://kotlinlang.org/docs/home.html
21-
[github]: https://github.com/lakiboy
22-
[issues]: https://github.com/kotlin-hands-on/advent-of-code-kotlin-template/issues
23-
[kotlin]: https://kotlinlang.org
24-
[slack]: https://surveys.jetbrains.com/s3/kotlin-slack-sign-up
25-
[template]: https://github.com/kotlin-hands-on/advent-of-code-kotlin-template
16+
| Day | Title | Task | Input | Solution | Test |
17+
|-----|-------------------------|----------------------------------------------|--------------------------------------|--------------------------------------------------------|----------------------------------------------------------|
18+
| 1 | Calorie Counting | [Docs](https://adventofcode.com/2022/day/1) | [Text](src/main/resources/day01.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day01.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day01Test.kt) |
19+
| 2 | Rock Paper Scissors | [Docs](https://adventofcode.com/2022/day/2) | [Text](src/main/resources/day02.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day02.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day02Test.kt) |
20+
| 3 | Rucksack Reorganization | [Docs](https://adventofcode.com/2022/day/3) | [Text](src/main/resources/day03.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day03.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day03Test.kt) |
21+
| 4 | Camp Cleanup | [Docs](https://adventofcode.com/2022/day/4) | [Text](src/main/resources/day04.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day04.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day04Test.kt) |
22+
| 5 | Supply Stacks | [Docs](https://adventofcode.com/2022/day/5) | [Text](src/main/resources/day05.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day05.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day05Test.kt) |
23+
| 6 | Tuning Trouble | [Docs](https://adventofcode.com/2022/day/6) | [Text](src/main/resources/day06.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day06.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day06Test.kt) |
24+
| 7 | No Space Left On Device | [Docs](https://adventofcode.com/2022/day/7) | [Text](src/main/resources/day07.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day07.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day07Test.kt) |
25+
| 8 | Treetop Tree House | [Docs](https://adventofcode.com/2022/day/8) | [Text](src/main/resources/day08.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day08.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day08Test.kt) |
26+
| 9 | Rope Bridge | [Docs](https://adventofcode.com/2022/day/9) | [Text](src/main/resources/day09.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day09.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day09Test.kt) |
27+
| 10 | Cathode-Ray Tube | [Docs](https://adventofcode.com/2022/day/10) | [Text](src/main/resources/day10.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day10.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day10Test.kt) |
28+
| 11 | Monkey in the Middle | [Docs](https://adventofcode.com/2022/day/11) | [Text](src/main/resources/day11.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day11.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day11Test.kt) |
29+
| 12 | Hill Climbing Algorithm | [Docs](https://adventofcode.com/2022/day/12) | [Text](src/main/resources/day12.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day12.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day12Test.kt) |
30+
| 13 | Distress Signal | [Docs](https://adventofcode.com/2022/day/13) | [Text](src/main/resources/day13.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day13.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day13Test.kt) |
31+
| 14 | Regolith Reservoir | [Docs](https://adventofcode.com/2022/day/14) | [Text](src/main/resources/day14.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day14.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day14Test.kt) |
32+
| 15 | Beacon Exclusion Zone | [Docs](https://adventofcode.com/2022/day/15) | [Text](src/main/resources/day15.txt) | [Source](src/main/kotlin/io/dmitrijs/aoc2022/Day15.kt) | [Test](src/test/kotlin/io/dmitrijs/aoc2022/Day15Test.kt) |

build.gradle.kts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
13
plugins {
24
kotlin("jvm") version "1.7.22"
5+
id("org.jetbrains.kotlinx.benchmark") version "0.4.6"
6+
id("io.gitlab.arturbosch.detekt") version "1.22.0"
37
}
48

59
repositories {
610
mavenCentral()
711
}
812

13+
dependencies {
14+
testImplementation(kotlin("test"))
15+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0")
16+
}
17+
918
tasks {
10-
sourceSets {
11-
main {
12-
java.srcDirs("src")
19+
withType<KotlinCompile> {
20+
kotlinOptions {
21+
jvmTarget = JavaVersion.VERSION_17.toString()
1322
}
1423
}
15-
16-
wrapper {
17-
gradleVersion = "7.6"
24+
test {
25+
useJUnitPlatform()
1826
}
1927
}
28+
29+
detekt {
30+
config = files("detekt-config.yml")
31+
buildUponDefaultConfig = true
32+
}

detekt-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
style:
2+
MagicNumber:
3+
active: false
4+
DestructuringDeclarationWithTooManyEntries:
5+
maxDestructuringEntries: 5

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name = "advent-of-code-22-kotlin"
1+
rootProject.name = "advent-of-code-2022-kotlin"

src/Utils.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/day_01/puzzle.kt

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/day_02/puzzle.kt

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/day_03/puzzle.kt

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)