Advent of Code is back this year and It starts tomorrow, December 1
Every day at 2:00LT until December 25 you will get a two part programming puzzle with a christmas theme.
https://adventofcode.com/
I first started doing it in 2021 but i only got to
In 2022, i improved on it but still i couldn't finish the whole thing, I stopped after
For this year's AoC my hope is to finish all 25 puzzles (with multiple languages). For most days i will be at uni in the mornings so i won't be able to solve the puzzles right after they are published at 2:00 LT, i will instead do them in the late afternoon or in the evening.
I will be publishing my solutions in this github repo
https://github.com/frectonz/advent_of_code_2023
PS: I have a mid exam tomorrow π so i am probably going to do the puzzle in the evening.
Every day at 2:00LT until December 25 you will get a two part programming puzzle with a christmas theme.
https://adventofcode.com/
I first started doing it in 2021 but i only got to
Day 5 (all 5 were in rust), i wasn't able to finish it and fully follow along with it because of school and stuff.In 2022, i improved on it but still i couldn't finish the whole thing, I stopped after
Day 14, but the cool part about the 2022 AoC was i was becoming a programming language polyglot and used Rust, Elm, Go, OCaml, TypeScript to solve the puzzles. I also was posting my progress here.For this year's AoC my hope is to finish all 25 puzzles (with multiple languages). For most days i will be at uni in the mornings so i won't be able to solve the puzzles right after they are published at 2:00 LT, i will instead do them in the late afternoon or in the evening.
I will be publishing my solutions in this github repo
https://github.com/frectonz/advent_of_code_2023
PS: I have a mid exam tomorrow π so i am probably going to do the puzzle in the evening.
π₯11π1
Frectonz
Advent of Code is back this year and It starts tomorrow, December 1 Every day at 2:00LT until December 25 you will get a two part programming puzzle with a christmas theme. https://adventofcode.com/ I first started doing it in 2021 but i only got to Dayβ¦
I just completed "Trebuchet?!" - Day 1 - Advent of Code 2023
Today's challenge mostly had to do with parsing the input correctly.
First part was easy, as always
In the second part i ran into a wall, all of the tests were passing but when i ran it with the main input, it didn't work (this is the worst situation to be in while doing AoC).
Today's challenge mostly had to do with parsing the input correctly.
First part was easy, as always
In the second part i ran into a wall, all of the tests were passing but when i ran it with the main input, it didn't work (this is the worst situation to be in while doing AoC).
π1
Frectonz
I just completed "Trebuchet?!" - Day 1 - Advent of Code 2023 Today's challenge mostly had to do with parsing the input correctly. First part was easy, as always In the second part i ran into a wall, all of the tests were passing but when i ran it withβ¦
I was using this parser combinators lib called nom. What you had to parse was turning words to digits like this
"one" = 1
'two" = 2
...
"nine" = 3
but the thing i didn't notice while i wrote the parser was that
"twone" = 2, 1
"oneight" = 1, 8
The words could overlap each other and the problem was this didn't conform with how nom and most other parser combinator libraries work. Parser combinator libs scan the input string eating away the things they have parsed out.
For example, "twone" with the first implementation of my parser, would be turned into (2, "ne"), see how the "o" got taken away, that was the problem.
FInding out that this was a problem took me sometime but i finally figured it out.
So the lesson here is, "don't use a parser combinator lib for everything, sometimes regex is enough"
"one" = 1
'two" = 2
...
"nine" = 3
but the thing i didn't notice while i wrote the parser was that
"twone" = 2, 1
"oneight" = 1, 8
The words could overlap each other and the problem was this didn't conform with how nom and most other parser combinator libraries work. Parser combinator libs scan the input string eating away the things they have parsed out.
For example, "twone" with the first implementation of my parser, would be turned into (2, "ne"), see how the "o" got taken away, that was the problem.
FInding out that this was a problem took me sometime but i finally figured it out.
So the lesson here is, "don't use a parser combinator lib for everything, sometimes regex is enough"
π1
I've completed "Cube Conundrum" - Day 2 - Advent of Code 2023
https://adventofcode.com/2023/day/2
I did this one in Elm.
[Part 1 Solution] [Part 2 Solution]
https://adventofcode.com/2023/day/2
I did this one in Elm.
[Part 1 Solution] [Part 2 Solution]
π₯6
Frectonz
I've completed "Cube Conundrum" - Day 2 - Advent of Code 2023 https://adventofcode.com/2023/day/2 I did this one in Elm. [Part 1 Solution] [Part 2 Solution]
Model your data well and the algorithms you want will almost write themselves.
π3
Frectonz
Model your data well and the algorithms you want will almost write themselves.
I know i said parser combinator libs are not always needed but i couldn't help myself.
Just look at it, it's beautiful.
The top level parser is
Just look at it, it's beautiful.
The top level parser is
game, and it has a nice hierarchy of small parsers.game calls into cubeSets calls into cubeSet calls into cubeπ₯3
I've completed "Gear Ratios" - Day 3 - Advent of Code 2023
I used OCaml π« for this one.
[Part 1 Solution] [Part 2 Solution]
I used OCaml π« for this one.
[Part 1 Solution] [Part 2 Solution]
π₯2π1
Frectonz
I've completed "Gear Ratios" - Day 3 - Advent of Code 2023 I used OCaml π« for this one. [Part 1 Solution] [Part 2 Solution]
|> is the bestevery language should have some way of composing functions by passing the output of one function as an input to another.