/advent-of-code-scala

Advent of code solutions with Scala 3

Primary LanguageScalaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Advent of Code Scala 3 Solution

This solution aims to write elegant FP style code.

Note: I am a Haskell programmer who is learning Scala with this AoC.

  • Use enums and case classes for better readablity and more strict typecheck
  • Use immutable collections as much as possible
  • Use val and avoid var as much as possible
  • Prefer utilizing Scala base library over Cats

Instruction

# Runs code in year 2022, day 1 with input file stored in 'src/main/resources/' directory.
./run.sh 2022 01