├── .github ├── readme │ ├── cover.png │ ├── livestream.png │ └── run.png ├── template-cleanup │ ├── README.md │ └── settings.gradle.kts └── workflows │ └── template-cleanup.yml ├── .gitignore ├── .idea ├── file.template.settings.xml └── fileTemplates │ ├── Advent of Code.kt │ └── Advent of Code.kt.child.0.txt ├── LICENSE ├── README.md ├── build.gradle.kts ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── src ├── Day01.kt └── Utils.kt /.github/readme/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotlin-hands-on/advent-of-code-kotlin-template/c4b5dbb46d583bb4b68b06c4561213214d3f7911/.github/readme/cover.png -------------------------------------------------------------------------------- /.github/readme/livestream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotlin-hands-on/advent-of-code-kotlin-template/c4b5dbb46d583bb4b68b06c4561213214d3f7911/.github/readme/livestream.png -------------------------------------------------------------------------------- /.github/readme/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotlin-hands-on/advent-of-code-kotlin-template/c4b5dbb46d583bb4b68b06c4561213214d3f7911/.github/readme/run.png -------------------------------------------------------------------------------- /.github/template-cleanup/README.md: -------------------------------------------------------------------------------- 1 | # %NAME% 2 | 3 | Welcome to the Advent of Code[^aoc] Kotlin project created by [%ACTOR%][github] using the [Advent of Code Kotlin Template][template] delivered by JetBrains. 4 | 5 | In this repository, %ACTOR% is about to provide solutions for the puzzles using [Kotlin][kotlin] language. 6 | 7 | If you're stuck with Kotlin-specific questions or anything related to this template, check out the following resources: 8 | 9 | - [Kotlin docs][docs] 10 | - [Kotlin Slack][slack] 11 | - Template [issue tracker][issues] 12 | 13 | 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/%ACTOR% 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 26 | -------------------------------------------------------------------------------- /.github/template-cleanup/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "%NAME%" 2 | 3 | dependencyResolutionManagement { 4 | repositories { 5 | mavenCentral() 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.github/workflows/template-cleanup.yml: -------------------------------------------------------------------------------- 1 | # GitHub Actions Workflow responsible for cleaning up the Advent of Code Kotlin Template repository from 2 | # the template-specific files and configurations. This workflow is supposed to be triggered automatically 3 | # when a new template-based repository has been created. 4 | 5 | name: Template Cleanup 6 | on: 7 | push: 8 | branches: [main] 9 | 10 | jobs: 11 | 12 | # Run cleaning process only if workflow is triggered by the non-"advent-of-code-kotlin-template" repository. 13 | template-cleanup: 14 | name: Template Cleanup 15 | runs-on: ubuntu-latest 16 | if: github.event.repository.name != 'advent-of-code-kotlin-template' 17 | permissions: 18 | contents: write 19 | steps: 20 | 21 | # Check out current repository 22 | - name: Fetch Sources 23 | uses: actions/checkout@v4 24 | 25 | # Cleanup project 26 | - name: Cleanup 27 | run: | 28 | export LC_CTYPE=C 29 | export LANG=C 30 | 31 | # Prepare variables 32 | NAME="${GITHUB_REPOSITORY##*/}" 33 | ACTOR=$(echo $GITHUB_ACTOR | tr '[:upper:]' '[:lower:]') 34 | SAFE_NAME=$(echo $NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') 35 | SAFE_ACTOR=$(echo $ACTOR | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') 36 | GROUP="com.github.$SAFE_ACTOR.$SAFE_NAME" 37 | 38 | # Replace placeholders in the template-cleanup files 39 | sed -i "s/%ACTOR%/$ACTOR/g" .github/template-cleanup/* 40 | sed -i "s/%NAME%/$NAME/g" .github/template-cleanup/* 41 | sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" .github/template-cleanup/* 42 | sed -i "s/%GROUP%/$GROUP/g" .github/template-cleanup/* 43 | 44 | # Move content 45 | cp -R .github/template-cleanup/* . 46 | 47 | # Cleanup 48 | rm -rf \ 49 | .github/readme \ 50 | .github/template-cleanup \ 51 | .github/workflows/template-cleanup.yml \ 52 | LICENSE 53 | 54 | # Remove leftover empty directories 55 | find . -type d -empty -delete 56 | 57 | # Commit modified files 58 | - name: Commit files 59 | run: | 60 | git config --local user.email "action@github.com" 61 | git config --local user.name "GitHub Action" 62 | git add . 63 | git commit -m "Template cleanup" 64 | 65 | # Push changes 66 | - name: Push changes 67 | uses: ad-m/github-push-action@master 68 | with: 69 | branch: main 70 | github_token: ${{ secrets.GITHUB_TOKEN }} 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .idea 3 | .kotlin/ 4 | build 5 | src/**/*.txt 6 | local.properties 7 | -------------------------------------------------------------------------------- /.idea/file.template.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |