Skip to content

manuphatak/HaskellAdventOfCode2020

Repository files navigation

manuphatak codecov

AdventOfCode 2020

Solutions to adventofcode.com/2020

50 Stars

Solutions (Link)

PR Problem Solution Specs
PR #2 Day 1: Report Repair src/Day01/Solution.hs test/Day01/SolutionSpec.hs
PR #4 Day 2: Password Philosophy src/Day02/Solution.hs test/Day02/SolutionSpec.hs
PR #5 Day 3: Toboggan Trajectory src/Day03/Solution.hs test/Day03/SolutionSpec.hs
PR #6 Day 4: Passport Processing src/Day04/Solution.hs test/Day04/SolutionSpec.hs
PR #7 Day 5: Binary Boarding src/Day05/Solution.hs test/Day05/SolutionSpec.hs
PR #8 Day 6: Custom Customs src/Day06/Solution.hs test/Day06/SolutionSpec.hs
PR #12 Day 7: Handy Haversacks src/Day07/Solution.hs test/Day07/SolutionSpec.hs
PR #13 Day 8: Handheld Halting src/Day08/Solution.hs test/Day08/SolutionSpec.hs
PR #15 Day 9: Encoding Error src/Day09/Solution.hs test/Day09/SolutionSpec.hs
PR #18 Day 10: Adapter Array src/Day10/Solution.hs test/Day10/SolutionSpec.hs
PR #19 Day 11: Seating System src/Day11/Solution.hs test/Day11/SolutionSpec.hs
PR #21 Day 12: Rain Risk src/Day12/Solution.hs test/Day12/SolutionSpec.hs
PR #23 Day 13: Shuttle Search src/Day13/Solution.hs test/Day13/SolutionSpec.hs
PR #24 Day 14: Docking Data src/Day14/Solution.hs test/Day14/SolutionSpec.hs
PR #25 Day 15: Rambunctious Recitation [in progress, 2 stars] [in progress]
PR #26 Day 16: Ticket Translation src/Day16/Solution.hs test/Day16/SolutionSpec.hs
PR #30 Day 17: Conway Cubes src/Day17/Solution.hs test/Day17/SolutionSpec.hs
PR #31 Day 18: Operation Order src/Day18/Solution.hs test/Day18/SolutionSpec.hs
PR #32 Day 19: Monster Messages src/Day19/Solution.hs test/Day19/SolutionSpec.hs
PR #34 Day 20: Jurassic Jigsaw src/Day20/Solution.hs test/Day20/SolutionSpec.hs
PR #35 Day 21: Allergen Assessment src/Day21/Solution.hs test/Day21/SolutionSpec.hs
PR #38 Day 22: Crab Combat src/Day22/Solution.hs test/Day22/SolutionSpec.hs
PR #40 Day 23: Crab Cups [in progress, 2 stars] [in progress]
PR #44 Day 24: Lobby Layout src/Day24/Solution.hs test/Day24/SolutionSpec.hs
PR #45 Day 25: Combo Breaker [in progress, 2 star ] [in progress]

Run tests

$ stack test --file-watch --fast

Workflow

Start a new day Part 1

$ day 1 commit

./bin/day 1 commit Creates a workspace to solve a new day's problem.

Steps

  • copies the Template directories and string replaces placeholder values
  • fetches input the problem input and saves it to ./test/Day01/input.txt
  • fetches the problem statement, converts it to markdown, and saves it as ./src/Day01/README.md
  • updates the .cabal file
  • if commit is included
    • creates a branch
    • adds and commits the new files
    • pushes the branch to origin
    • opens a pull-request

Continue to Part 2

$ readme 1

./bin/readme 1 After solving part 1, get a new README with the full problem statement including part 2.

Setup

Dependencies

  • direnv - used to add project specific env variables
  • yarn global add @bionikspoon/html-to-md
  • yarn global add prettier
  • go get github.com/ericchiang/pup
  • https://hub.docker.com/ API key for Circle CI
  • https://codecov.io/ project token for circle CI

Getting Started

  1. Create an .envrc

    $ cp .envrc.sample .envrc
  2. Add a SESSION_ID to the .envrc

    • go to https://adventofcode.com/
    • login
    • Right click -> "Inspect" -> Click the "Application" tab -> Look for "Storage -> Cookies -> https://adventofcode.com/" -> Copy the "session" value
    • Save the "session" value as SESSION_ID in .envrc
  3. Enable the .envrc file

    $ direnv allow
  4. Add environment variables to CircleCI

    • CODECOV_TOKEN
    • DOCKERHUB_PASSWORD
    • DOCKERHUB_USERNAME
  5. Setup .hspec

    $ cp .hspec.sample .hspec

About

Solutions to adventofcode.com/2020

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published