Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pgebert/advent-of-code-kotlin-template

Advent of code template for kotlin.
https://github.com/pgebert/advent-of-code-kotlin-template

advent-of-code advent-of-code-in-kotlin aoc boilerplate kotlin template

Last synced: 3 months ago
JSON representation

Advent of code template for kotlin.

Awesome Lists containing this project

README

        

# 🎄 [Advent Of Code](https://adventofcode.com)

![Current day](https://img.shields.io/badge/Day-0-blue)
![Stars obtained](https://img.shields.io/badge/Stars%20Obtained%20⭐-0-yellow)
![Days completed](https://img.shields.io/badge/Days%20Completed-0-red)

### Daily Solution Index

| Day | Title | Part 1 | Part 2 | Code |
|------|----------------|:------:|:------:|---------------------------------------------------------------------------------------------------------------------------------|
| ✔ 01 | (not released) | ⭐ | ⭐ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day01.kt) |
| ⚪ 02 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day02.kt) |
| ⚪ 03 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day03.kt) |
| ⚪ 04 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day04.kt) |
| ⚪ 05 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day05.kt) |
| ⚪ 06 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day06.kt) |
| ⚪ 07 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day07.kt) |
| ⚪ 08 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day08.kt) |
| ⚪ 09 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day09.kt) |
| ⚪ 10 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day10.kt) |
| ⚪ 11 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day11.kt) |
| ⚪ 12 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day12.kt) |
| ⚪ 13 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day13.kt) |
| ⚪ 14 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day14.kt) |
| ⚪ 15 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day15.kt) |
| ⚪ 16 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day16.kt) |
| ⚪ 17 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day17.kt) |
| ⚪ 18 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day18.kt) |
| ⚪ 19 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day19.kt) |
| ⚪ 20 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day20.kt) |
| ⚪ 21 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day21.kt) |
| ⚪ 22 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day22.kt) |
| ⚪ 23 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day23.kt) |
| ⚪ 24 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day24.kt) |
| ⚪ 25 | (not released) | ⚪ | ⚪ | [![Code](https://img.shields.io/badge/Code-grey?style=for-the-badge&logo=Kotlin)](src/main/kotlin/de/pgebert/aoc/days/Day25.kt) |

---

# How to use this template

## Getting Started

### 1. Download daily input data

Copy your daily input data from the advent of code page to the corresponding `*.txt` file in `src/main/resources`.

### 2. Implement your solution

Use the prepared solution classes under `src/main/kotlin/days` and implement the method stubs for partOne and partTwo.
Each
day has two properties:

- `inputString`: the input data as one string
- `inputList`: the input data splitted into lines

So your solution can be implemented in the following way:

```kotlin
object Day01 : Day(1, "Day1") {

override fun partOne() = inputString.doSomething()

override fun partTwo() = inputList.map { it.doSomething() }
}

```

### 3. Update tests

This step is optional, but it's a nice way to proof that your solution is valid:

Extend the test factory in `src/test/kotlin/de/pgebert/aoc/DaysTest.kt`.

## Additional notes

### Testing with example data

By default, the input is read from the input file of the corresponding day, but for development it can be useful
to test against the provided example input. This can be achieved very easily:

```kotlin
@Test
fun `testing day 01 example`() {
val example = """
1abc2
pqr3stu8vwx
a1b2c3d4e5f
treb7uchet
"""

val day = Day01(input = example)

day.partOne() shouldBe 142
}

```

# Miscellaneous

## 🤝 Contributing

Contributions, [issues](https://github.com/pgebert/advent-of-code-kotlin-template/issues)
and [feature](https://github.com/pgebert/advent-of-code-kotlin-template/pulls) requests are welcome!

## Show your support

Give a ⭐️ if this [project](https://github.com/pgebert/advent-of-code-kotlin-template) helped you!