Advent of Code 2021 - Haskell
Objective: Get better at Haskell, and at functional programming in general. Picks up from Haskell learnings in Project Euler 021 and Project Euler 022 .
The source code is available on Github .
Dated Feb 18, 2022; last modified on Fri, 18 Feb 2022
Objective: Get better at Haskell, and at functional programming in general. Picks up from Haskell learnings in Project Euler 021 and Project Euler 022 .
The source code is available on Github .
| Random Link ¯\_(ツ)_/¯ | ||
| Apr 12, 2022 | » | AoC 2021 Day 10: Syntax Scoring
2 min; updated Apr 12, 2022
Day 10 - Advent of Code 2021.
Eric Wastl.
Part IYou ask the submarine to determine the best route out of the deep-sea cave, but it only replies: The navigation subsystem is made of several lines containing chunks. There are one or more chunks on each line, and chunks contain zero or more other chunks. Adjacent chunks are not separated by any delimiter; if one chunk stops, the next chunk (if any) can immediately start. Every chunk must open and close with one of four legal pairs of matching characters: ... |
| Apr 11, 2022 | » | AoC 2021 Parsing Arguments
2 min; updated Apr 11, 2022
Parsing the Command Linelists a couple of libraries. and are the most popular options. Going with as it’s slightly more popular. A type |
| Apr 11, 2022 | » | AoC 2021 Test Code
4 min; updated Apr 11, 2022
|
| Apr 11, 2022 | » | AoC 2021 Solution Runner
4 min; updated Apr 11, 2022
|
| Apr 11, 2022 | » | AoC 2021 Main
1 min; updated Apr 11, 2022
|
| Mar 16, 2022 | » | AoC 2021 Day 09: Smoke Basin
13 min; updated Mar 16, 2022
massiv; Fusion; Box vs. Unboxed; Connected Components; Data.Set; Monadic map |
| Mar 7, 2022 | » | AoC 2021 Input Parser
8 min; updated Mar 7, 2022
Day 03: Binary DiagnosticDay 04: Giant SquidDay 05: Hydrothermal VentureDay 06: LanternfishDay 07: Treachery of WhalesDay 08: Seven Segment SearchI gave up on using |
| Mar 7, 2022 | » | AoC 2021 Day 08: Seven Segment Search
15 min; updated Mar 7, 2022
Day 8 - Advent of Code 2021.
Eric Wastl.
Part I DescriptionYou barely reach the safety of the cave when the whale smashes into the cave mouth, collapsing it. Sensors indicate another exit to this cave at a much greater depth, so you have no choice but to press on. As your submarine slowly makes its way through the cave system, you notice that the four-digit seven-segment displays in your submarine are malfunctioning; they must have been damaged during the escape. You’ll be in a lot of trouble without them, so you’d better figure out what’s wrong. ... |
| Mar 5, 2022 | » | AoC 2021 Day 07: The Treachery of Whales
7 min; updated Mar 5, 2022
Day 7 - Advent of Code 2021.
Eric Wastl.
Part I DescriptionA giant whale has decided that your submarine is its next meal, and it’s much faster than you are. There’s nowhere to run! Suddenly, a swarm of crabs (each in its own tiny submarine - it’s too deep for them otherwise) zooms in to rescue you! They seem to be preparing to blast a hole in the ocean floor; sensors indicate a massive underground cave system just beyond where they’re aiming! ... |
| Mar 1, 2022 | » | AoC 2021 Day 06: Lanternfish
12 min; updated Mar 1, 2022
Day 6 - Advent of Code 2021.
Eric Wastl.
Part I DescriptionThe sea floor is getting steeper. Maybe the sleigh keys got carried this way? A massive school of glowing lanternfish swims past. They must spawn quickly to reach such large numbers - maybe exponentially quickly? You should model their growth to be sure. ... |
| Feb 27, 2022 | » | AoC 2021 Day 05: Hydrothermal Venture
4 min; updated Feb 27, 2022
Problem StatementPart OneYou come across a field of hydrothermal vents on the ocean floor! These vents constantly produce large, opaque clouds, so it would be best to avoid them if possible. They tend to form in lines; the submarine hopefully produces a list of nearby lines of vents (your puzzle input) for you to review. Each line of vents is given as a line segment in the format |
| Feb 25, 2022 | » | AoC 2021 Day 04: Giant Squid
6 min; updated Feb 25, 2022
Day 4 - Advent of Code 2021.
Eric Wastl.
Part OneYou’re already almost 1.5km (almost a mile) below the surface of the ocean, already so deep that you can’t see any sunlight. What you can see, however, is a giant squid that has attached itself to the outside of your submarine. ... |
| Feb 23, 2022 | » | AoC 2021 Day 03: Binary Diagnostic
14 min; updated Feb 23, 2022
Day 3 - Advent of Code 2021.
Eric Wastl.
Problem DescriptionPart OneThe submarine has been making some odd creaking noises, so you ask it to produce a diagnostic report just in case. The diagnostic report (your puzzle input) consists of a list of binary numbers which, when decoded properly, can tell you many useful things about the conditions of the submarine. The first parameter to check is the power consumption. ... |
| Feb 19, 2022 | » | AoC 2021 Day 02: Dive!
12 min; updated Feb 19, 2022
Day 2 - Advent of Code 2021.
Eric Wastl.
Problem StatementPart OneNow, you need to figure out how to pilot this thing. It seems like the submarine can take a series of commands like
|
| Feb 19, 2022 | » | Learning Haskell via AoC 2021
14 min; updated Feb 19, 2022
This page contains remarks on Haskell that I encountered when working with source files that span multiple AoC 2021 problems. and have Haskell solutions. It’ll be nice to compare how they solved the problems. I don’t want to end up perfecting the wrong approach! Setting Up Haskell Env for AoCTo manage dependencies, Cabal and Stack are pretty popular. Stack incorporates the Cabal build system. ... |
| Feb 18, 2022 | » | AoC 2021 Day 01: Sonar Sweep
6 min; updated Feb 18, 2022
Day 1 - Advent of Code 2021: Sonar Sweep.
Eric Wastl.
Part OneAs the submarine drops below the surface of the ocean, it automatically performs a sonar sweep of the nearby sea floor. On a small screen, the sonar weep report (your puzzle input) appears: each line is a measurement of the sea floor depth as the sweep looks further and further away from the submarine. ... |
Can’t submarines move backwards? Why is there no
...backward X?