Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petertseng/adventofcode-hs-2019
Solutions to https://adventofcode.com/2019 (all but day 25, unlikely to add day 25 due to lack of interest)
https://github.com/petertseng/adventofcode-hs-2019
advent-of-code advent-of-code-2019 haskell
Last synced: 29 days ago
JSON representation
Solutions to https://adventofcode.com/2019 (all but day 25, unlikely to add day 25 due to lack of interest)
- Host: GitHub
- URL: https://github.com/petertseng/adventofcode-hs-2019
- Owner: petertseng
- License: apache-2.0
- Created: 2019-10-26T22:30:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-23T21:13:01.000Z (about 2 months ago)
- Last Synced: 2024-12-23T22:20:43.572Z (about 2 months ago)
- Topics: advent-of-code, advent-of-code-2019, haskell
- Language: Haskell
- Homepage: https://adventofcode.com/2019
- Size: 43.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code
[![Build Status](https://travis-ci.org/petertseng/adventofcode-hs-2019.svg?branch=master)](https://travis-ci.org/petertseng/adventofcode-hs-2019)
These are my solutions to http://adventofcode.com
All solutions are written in Haskell.
I didn't feel like writing day 25.
## Input
In general, all solutions can be invoked in both of the following ways:
* Without command-line arguments, takes input on standard input.
* With 1+ command-line arguments, reads input from the first, which must be the path to an input file.
Arguments beyond the first are ignored.Some may additionally support other ways:
* All intcode days: May pass the intcode in ARGV as a single argument separated by commas.
* Day 04 (Password): May pass min and max in ARGV (as two args, or as one arg joined by a hyphen).## Closing thoughts
Non-strict evaluation comes in handy, especially when different days might share a common approach but impose different termination conditions.
For example, some days want to BFS all goals, but some just want to BFS a single goal.
In other languages, that is most conveniently achieved by adding a parameter that controls how many goals the BFS attempts to find.
In Haskell, the BFS simply attempts to find them all, and if a day only wants one goal, it only asks for one.
Thus, the others don't get computed.I can apparently be extraordinarily uncreative with names - use `git grep "''"` to see how many times I use `''`.