2m / adventofcode2020

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository contains solutions to various puzzles of the Advent of Code 2020. Puzzles are solved with various idioms and libraries from the Scala ecosystem.

Ammonite is used to run the code. It is available from many package managers (e.g. brew install ammonite-repl). When running a puzzle solution (e.g. amm day2.sc) dependencies will be downloaded automatically. Probably will register any assertions in the code and will print a summary:

┌─────┬────────┬──────────────────────────────────────────────┬───────┬───────┐
│     │ Hash   │ Test                                         │ Time  │ Debug │
├─────┼────────┼──────────────────────────────────────────────┼───────┼───────┤
│  ✓  │ 71d872 │ valid paswords by the first validation rule  │ 0.046 │       │
│  ✓  │ baa61a │ valid paswords by the second validation rule │ 0.001 │       │
└─────┴────────┴──────────────────────────────────────────────┴───────┴───────┘
Passed: 2   Failed: 0   Total: 2

 ✓  Pass                               ✗  Fail
 ?  Throws in check                    !  Throws in body
 ±  Fails sometimes                    #  Suite partially fails

List of solutions and Scala idioms/libraries used:

Puzzle Idioms and libraries
Day 1 Ammonite Ops, set operations
Day 2 Regex pattern matching
Day 3 For Comprehensions
Day 4 Akka Streams, Match on interpolator
Day 5 Parsing text to integers
Day 6 fs2, semigroup
Day 7 scala-graph
Day 8 var, Mutable Collections
Day 9 Collections Sliding Window, Tails
Day 10 Collections Sliding Window
Day 11 Try, Success, Failure
Day 12 fs2, LazyList
Day 13 minBy
Day 14 fs2
Day 15 fs2
Day 16

About


Languages

Language:Scala 100.0%