Advent of Code solutions

reorganizing repo into a single branch

+6 -333
-1
.env.example
··· 1 1 SESSION= 2 - YEAR=2024
-13
2020/.gitignore
··· 1 - input 2 - sample 3 - .env 4 - err 5 - out 6 - build 7 - *.hi 8 - *.o 9 - p1 10 - .p1 11 - p2 12 - .p2 13 - dist-newstyle
-50
2020/Justfile
··· 1 - set dotenv-load 2 - set quiet 3 - set shell := ["fish", "-c"] 4 - 5 - year := env_var("YEAR") 6 - session := env_var("SESSION") 7 - 8 - [no-cd] 9 - default: p1 p2 10 - 11 - all: 12 - #!/usr/bin/env fish 13 - for file in (ls) 14 - if test -d $file 15 - echo "Day $file" 16 - just run $file 17 - end 18 - end 19 - 20 - [no-cd] 21 - p1 input="input": (do "p1" input) 22 - 23 - [no-cd] 24 - p2 input="input": (do "p2" input) 25 - 26 - [no-cd] 27 - do part input: 28 - #!/usr/bin/env fish 29 - if test -f {{part}}.hs 30 - ghc {{part}} -O -outputdir.{{part}} > /dev/null 31 - and time ./{{part}} < {{input}} 32 - else if ls | rg "\.cabal\$" -q 33 - cabal build {{part}} > /dev/null 34 - and time cabal run {{part}} < {{input}} 35 - else if test -f {{part}}.fish 36 - time ./{{part}}.fish < {{input}} 37 - else 38 - echo "Current directory does not contain known solution configuration" 39 - exit 1 40 - end 41 - 42 - run day: 43 - cd {{day}} && just 44 - 45 - get day: 46 - mkdir -p {{day}} 47 - curl https://adventofcode.com/{{year}}/day/{{day}}/input \ 48 - -X GET \ 49 - -H "Cookie: session={{session}}" \ 50 - -o {{day}}/input
-13
2021/.gitignore
··· 1 - input 2 - sample 3 - .env 4 - err 5 - out 6 - build 7 - *.hi 8 - *.o 9 - p1 10 - .p1 11 - p2 12 - .p2 13 - dist-newstyle
-50
2021/Justfile
··· 1 - set dotenv-load 2 - set quiet 3 - set shell := ["fish", "-c"] 4 - 5 - year := env_var("YEAR") 6 - session := env_var("SESSION") 7 - 8 - [no-cd] 9 - default: p1 p2 10 - 11 - all: 12 - #!/usr/bin/env fish 13 - for file in (ls) 14 - if test -d $file 15 - echo "Day $file" 16 - just run $file 17 - end 18 - end 19 - 20 - [no-cd] 21 - p1 input="input": (do "p1" input) 22 - 23 - [no-cd] 24 - p2 input="input": (do "p2" input) 25 - 26 - [no-cd] 27 - do part input: 28 - #!/usr/bin/env fish 29 - if test -f {{part}}.hs 30 - ghc {{part}} -O -outputdir.{{part}} > /dev/null 31 - and time ./{{part}} < {{input}} 32 - else if ls | rg "\.cabal\$" -q 33 - cabal build {{part}} > /dev/null 34 - and time cabal run {{part}} < {{input}} 35 - else if test -f {{part}}.fish 36 - time ./{{part}}.fish < {{input}} 37 - else 38 - echo "Current directory does not contain known solution configuration" 39 - exit 1 40 - end 41 - 42 - run day: 43 - cd {{day}} && just 44 - 45 - get day: 46 - mkdir -p {{day}} 47 - curl https://adventofcode.com/{{year}}/day/{{day}}/input \ 48 - -X GET \ 49 - -H "Cookie: session={{session}}" \ 50 - -o {{day}}/input
-13
2022/.gitignore
··· 1 - input 2 - sample 3 - .env 4 - err 5 - out 6 - build 7 - *.hi 8 - *.o 9 - p1 10 - .p1 11 - p2 12 - .p2 13 - dist-newstyle
2022/01/p1.sh 2022/1/p1.sh
2022/01/p2.sh 2022/1/p2.sh
2022/02/p1.pl 2022/2/p1.pl
2022/02/p2.pl 2022/2/p2.pl
2022/03/p1.py 2022/3/p1.py
2022/03/p2.py 2022/3/p2.py
2022/04/.gitignore 2022/4/.gitignore
2022/04/p1.c 2022/4/p1.c
2022/04/p2.c 2022/4/p2.c
2022/05/p1.pl 2022/5/p1.pl
2022/05/p2.pl 2022/5/p2.pl
2022/06/p1.rb 2022/6/p1.rb
2022/06/p2.rb 2022/6/p2.rb
2022/07/p1.io 2022/7/p1.io
2022/07/p2.io 2022/7/p2.io
2022/08/.gitignore 2022/8/.gitignore
2022/08/p1.cpp 2022/8/p1.cpp
2022/08/p2.cpp 2022/8/p2.cpp
2022/09/p1.clj 2022/9/p1.clj
2022/09/p2.clj 2022/9/p2.clj
-50
2022/Justfile
··· 1 - set dotenv-load 2 - set quiet 3 - set shell := ["fish", "-c"] 4 - 5 - year := env_var("YEAR") 6 - session := env_var("SESSION") 7 - 8 - [no-cd] 9 - default: p1 p2 10 - 11 - all: 12 - #!/usr/bin/env fish 13 - for file in (ls) 14 - if test -d $file 15 - echo "Day $file" 16 - just run $file 17 - end 18 - end 19 - 20 - [no-cd] 21 - p1 input="input": (do "p1" input) 22 - 23 - [no-cd] 24 - p2 input="input": (do "p2" input) 25 - 26 - [no-cd] 27 - do part input: 28 - #!/usr/bin/env fish 29 - if test -f {{part}}.hs 30 - ghc {{part}} -O -outputdir.{{part}} > /dev/null 31 - and time ./{{part}} < {{input}} 32 - else if ls | rg "\.cabal\$" -q 33 - cabal build {{part}} > /dev/null 34 - and time cabal run {{part}} < {{input}} 35 - else if test -f {{part}}.fish 36 - time ./{{part}}.fish < {{input}} 37 - else 38 - echo "Current directory does not contain known solution configuration" 39 - exit 1 40 - end 41 - 42 - run day: 43 - cd {{day}} && just 44 - 45 - get day: 46 - mkdir -p {{day}} 47 - curl https://adventofcode.com/{{year}}/day/{{day}}/input \ 48 - -X GET \ 49 - -H "Cookie: session={{session}}" \ 50 - -o {{day}}/input
-2
2022/README.md
··· 2 2 3 3 I return with a new language per day again. Maybe this year I'll remember to keep doing them. 4 4 5 - 1212704-0a296724 6 - 7 5 ## Reflection 8 6 9 7 25 languages is... a lot of languages. Started with ones I was familiar with but
-5
2023/.gitignore
··· 1 - input 2 - sample 3 - .env 4 - err 5 - out
-52
2023/Justfile
··· 1 - set dotenv-load 2 - set quiet 3 - set shell := ["fish", "-c"] 4 - 5 - year := env_var("YEAR") 6 - session := env_var("SESSION") 7 - 8 - [no-cd] 9 - default: p1 p2 10 - 11 - all: 12 - #!/usr/bin/env fish 13 - for file in (ls) 14 - if test -d $file 15 - echo "Day $file" 16 - just run $file 17 - end 18 - end 19 - 20 - [no-cd] 21 - p1 input="input": (do "p1" input) 22 - 23 - [no-cd] 24 - p2 input="input": (do "p2" input) 25 - 26 - [no-cd] 27 - do part input: 28 - #!/usr/bin/env fish 29 - if test -f {{part}}.hs 30 - ghc {{part}} -O -outputdir.{{part}} > /dev/null 31 - and time ./{{part}} < {{input}} 32 - else if ls | rg "\.cabal\$" -q 33 - cabal build {{part}} > /dev/null 34 - and time cabal run {{part}} < {{input}} 35 - else if test -f {{part}}.fish 36 - time ./{{part}}.fish < {{input}} 37 - else if test -f {{part}}.tri 38 - time trilogy run ./{{part}}.tri < {{input}} 39 - else 40 - echo "Current directory does not contain known solution configuration" 41 - exit 1 42 - end 43 - 44 - run day: 45 - cd {{day}} && just 46 - 47 - get day: 48 - mkdir -p {{day}} 49 - curl https://adventofcode.com/{{year}}/day/{{day}}/input \ 50 - -X GET \ 51 - -H "Cookie: session={{session}}" \ 52 - -o {{day}}/input
+1 -4
2023/README.md
··· 1 1 # Advent of Code 2023 2 2 3 - It's all [Trilogy](https://github.com/foxfriends/trilogy) this year, assuming 4 - the language continues to function for the duration. 5 - 6 - 1212704-0a296724 3 + It's all [Trilogy](https://github.com/foxfriends/trilogy) this year.
-13
2024/.gitignore
··· 1 - input 2 - sample 3 - .env 4 - err 5 - out 6 - build 7 - *.hi 8 - *.o 9 - p1 10 - .p1 11 - p2 12 - .p2 13 - dist-newstyle
-50
2024/Justfile
··· 1 - set dotenv-load 2 - set quiet 3 - set shell := ["fish", "-c"] 4 - 5 - year := env_var("YEAR") 6 - session := env_var("SESSION") 7 - 8 - [no-cd] 9 - default: p1 p2 10 - 11 - all: 12 - #!/usr/bin/env fish 13 - for file in (ls) 14 - if test -d $file 15 - echo "Day $file" 16 - just run $file 17 - end 18 - end 19 - 20 - [no-cd] 21 - p1 input="input": (do "p1" input) 22 - 23 - [no-cd] 24 - p2 input="input": (do "p2" input) 25 - 26 - [no-cd] 27 - do part input: 28 - #!/usr/bin/env fish 29 - if test -f {{part}}.hs 30 - ghc {{part}} -O -outputdir.{{part}} > /dev/null 31 - and time ./{{part}} < {{input}} 32 - else if ls | rg "\.cabal\$" -q 33 - cabal build {{part}} > /dev/null 34 - and time cabal run {{part}} < {{input}} 35 - else if test -f {{part}}.fish 36 - time ./{{part}}.fish < {{input}} 37 - else 38 - echo "Current directory does not contain known solution configuration" 39 - exit 1 40 - end 41 - 42 - run day: 43 - cd {{day}} && just 44 - 45 - get day: 46 - mkdir -p {{day}} 47 - curl https://adventofcode.com/{{year}}/day/{{day}}/input \ 48 - -X GET \ 49 - -H "Cookie: session={{session}}" \ 50 - -o {{day}}/input
+1 -1
2024/README.md
··· 1 1 # Advent of Code 2024 2 2 3 - `1212704-0a296724` 3 + Completed (mostly) using Haskell.
+4 -16
Justfile
··· 2 2 set quiet 3 3 set shell := ["fish", "-c"] 4 4 5 - year := env_var("YEAR") 5 + default_year := "2024" 6 6 session := env_var("SESSION") 7 7 8 8 [no-cd] 9 9 default: p1 p2 10 - 11 - all: 12 - #!/usr/bin/env fish 13 - for file in (ls) 14 - if test -d $file 15 - echo "Day $file" 16 - just run $file 17 - end 18 - end 19 10 20 11 [no-cd] 21 12 p1 input="input": (do "p1" input) ··· 39 30 exit 1 40 31 end 41 32 42 - run day: 43 - cd {{day}} && just 44 - 45 - get day: 46 - mkdir -p {{day}} 33 + get day year=default_year: 34 + mkdir -p {{year}}/{{day}} 47 35 curl https://adventofcode.com/{{year}}/day/{{day}}/input \ 48 36 -X GET \ 49 37 -H "Cookie: session={{session}}" \ 50 - -o {{day}}/input 38 + -o {{year}}/{{day}}/input