{"id":17337051,"url":"https://github.com/2m/adventofcode2020","last_synced_at":"2025-07-07T00:06:09.959Z","repository":{"id":55931419,"uuid":"317924667","full_name":"2m/adventofcode2020","owner":"2m","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-19T12:13:54.000Z","size":114,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T00:53:35.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-02T16:36:18.000Z","updated_at":"2022-08-05T20:11:33.000Z","dependencies_parsed_at":"2022-08-15T09:40:55.603Z","dependency_job_id":null,"html_url":"https://github.com/2m/adventofcode2020","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/2m/adventofcode2020","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2m%2Fadventofcode2020","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2m%2Fadventofcode2020/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2m%2Fadventofcode2020/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2m%2Fadventofcode2020/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2m","download_url":"https://codeload.github.com/2m/adventofcode2020/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2m%2Fadventofcode2020/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263991444,"owners_count":23540665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T15:33:40.417Z","updated_at":"2025-07-07T00:06:09.935Z","avatar_url":"https://github.com/2m.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository contains solutions to various puzzles of the [Advent of Code 2020][aoc2020].\nPuzzles are solved with various idioms and libraries from the Scala ecosystem.\n\n[Ammonite][amm] is used to run the code.\nIt is available from many package managers (e.g. `brew install ammonite-repl`).\nWhen running a puzzle solution (e.g. `amm day2.sc`) dependencies will be downloaded automatically.\n[Probably][probably] will register any assertions in the code and will print a summary:\n\n```\n┌─────┬────────┬──────────────────────────────────────────────┬───────┬───────┐\n│     │ Hash   │ Test                                         │ Time  │ Debug │\n├─────┼────────┼──────────────────────────────────────────────┼───────┼───────┤\n│  ✓  │ 71d872 │ valid paswords by the first validation rule  │ 0.046 │       │\n│  ✓  │ baa61a │ valid paswords by the second validation rule │ 0.001 │       │\n└─────┴────────┴──────────────────────────────────────────────┴───────┴───────┘\nPassed: 2   Failed: 0   Total: 2\n\n ✓  Pass                               ✗  Fail\n ?  Throws in check                    !  Throws in body\n ±  Fails sometimes                    #  Suite partially fails\n```\n\nList of solutions and Scala idioms/libraries used:\n\n| Puzzle             | Idioms and libraries                                                   |\n| ------------------ | ---------------------------------------------------------------------- |\n| [Day 1](day1.sc)   | [Ammonite Ops][amm-ops], set operations                                |\n| [Day 2](day2.sc)   | [Regex pattern matching][regex]                                        |\n| [Day 3](day3.sc)   | [For Comprehensions][for]                                              |\n| [Day 4](day4.sc)   | [Akka Streams][akka-streams], [Match on interpolator][match-interp]    |\n| [Day 5](day5.sc)   | [Parsing text to integers][parse-int]                                  |\n| [Day 6](day6.sc)   | [fs2][], [semigroup][]                                                 |\n| [Day 7](day7.sc)   | [scala-graph][]                                                        |\n| [Day 8](day8.sc)   | [var][], [Mutable Collections][mutable-coll]                           |\n| [Day 9](day9.sc)   | [Collections Sliding Window, Tails][subsets]                           |\n| [Day 10](day10.sc) | [Collections Sliding Window][subsets]                                  |\n| [Day 11](day11.sc) | [Try, Success, Failure][try]                                           |\n| [Day 12](day12.sc) | [fs2][], [LazyList][lazy-list]                                         |\n| [Day 13](day13.sc) | [minBy][]                                                              |\n| [Day 14](day14.sc) | [fs2][]                                                                |\n| [Day 15](day15.sc) | [fs2][]                                                                |\n| [Day 16](day16.sc) |                                                                        |\n\n[aoc2020]:      https://adventofcode.com/2020\n[amm]:          https://ammonite.io/\n[amm-ops]:      https://ammonite.io/#Operations\n[probably]:     https://github.com/propensive/probably\n[regex]:        https://www.scala-lang.org/api/2.13.3/scala/util/matching/Regex.html\n[for]:          https://docs.scala-lang.org/tour/for-comprehensions.html\n[akka-streams]: https://doc.akka.io/docs/akka/current/stream/stream-quickstart.html\n[match-interp]: https://cucumbersome.net/2020/11/28/four-new-features-of-scala-2-13-releases-that-you-probably-missed/#2130-s-interpolator-on-pattern-matching\n[parse-int]:    https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Integer.html#parseInt(java.lang.String,int)\n[fs2]:          https://fs2.io/guide.html\n[semigroup]:    https://typelevel.org/cats/typeclasses/semigroup.html\n[scala-graph]:  https://www.scala-graph.org/guides/core-initializing.html\n[var]:          https://docs.scala-lang.org/overviews/scala-book/two-types-variables.html\n[mutable-coll]: https://docs.scala-lang.org/overviews/collections-2.13/concrete-mutable-collection-classes.html\n[subsets]:      https://alvinalexander.com/scala/how-to-split-sequences-subsets-groupby-partition-scala-cookbook/\n[try]:          https://docs.scala-lang.org/overviews/scala-book/functional-error-handling.html#trysuccessfailure\n[lazy-list]:    https://www.scala-lang.org/api/current/scala/collection/immutable/LazyList.html\n[minBy]:        https://allaboutscala.com/tutorials/chapter-8-beginner-tutorial-using-scala-collection-functions/scala-minby-example/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2m%2Fadventofcode2020","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2m%2Fadventofcode2020","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2m%2Fadventofcode2020/lists"}