The Advent of Code [blog]

At some point in mid-2019 I discovered the advent of code and when it was released for 2019 I thought it would be a perfect chance to play with some code by way of simple(ish) challenge.
I think these next 25 days of puzzles are a perfect place to practice a programming language. I use it partly to keep the creative side of my brain active and to also practice a language that I don’t use all the time (it also makes for a good distraction from work if I’m needing one).


This content originally appeared on remy sharp's b:log and was authored by remy sharp's b:log

At some point in mid-2019 I discovered the advent of code and when it was released for 2019 I thought it would be a perfect chance to play with some code by way of simple(ish) challenge.

I think these next 25 days of puzzles are a perfect place to practice a programming language. I use it partly to keep the creative side of my brain active and to also practice a language that I don't use all the time (it also makes for a good distraction from work if I'm needing one).

Last year I decided rather than keep things straight forward I would attempt to each the two daily puzzles using the transformation language JQ. I wasn't able to solve them every day and tried to avoid the solved any hints, but I did get to day 16 but I was starting to eat into the start of January so decided I had had enough fun.

This year I'm doing JavaScript (mostly as the prototyping and planning but also to help others learn), jq and possibly (i.e. if I can fit it in) z80 assembly.

For me, JavaScript is reasonably easy and mostly going through the motions. jq is challenging but mostly because it's not really a programming language and doesn't have the constructs (or speed) I'm used to. z80 assembly is because I want to practice assembly and I really don't know how to solve a lot of problems using the language.

I've also created a couple of videos introducing the advent of code if you're a beginner and how I solved it in JavaScript (in real-time) and in jq. z80 will need a bit more time!

Here is the introduction and me working through the JavaScript solution - the aim of the video is to help beginners wanting to learn JavaScript and share my approach to problem solving:

Below is the solution using jq which had some native functions to do the job "easily" and yet the data being consumed was way too much so I needed to rethink the entire approach:

And if you want to poke around my code to see how I've done things, here's the git repo that I'll update as I go along: https://github.com/remy/advent-of-code-solved/

Originally published on Remy Sharp's b:log


This content originally appeared on remy sharp's b:log and was authored by remy sharp's b:log


Print Share Comment Cite Upload Translate Updates
APA

remy sharp's b:log | Sciencx (2020-12-01T00:00:00+00:00) The Advent of Code [blog]. Retrieved from https://www.scien.cx/2020/12/01/the-advent-of-code-blog/

MLA
" » The Advent of Code [blog]." remy sharp's b:log | Sciencx - Tuesday December 1, 2020, https://www.scien.cx/2020/12/01/the-advent-of-code-blog/
HARVARD
remy sharp's b:log | Sciencx Tuesday December 1, 2020 » The Advent of Code [blog]., viewed ,<https://www.scien.cx/2020/12/01/the-advent-of-code-blog/>
VANCOUVER
remy sharp's b:log | Sciencx - » The Advent of Code [blog]. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2020/12/01/the-advent-of-code-blog/
CHICAGO
" » The Advent of Code [blog]." remy sharp's b:log | Sciencx - Accessed . https://www.scien.cx/2020/12/01/the-advent-of-code-blog/
IEEE
" » The Advent of Code [blog]." remy sharp's b:log | Sciencx [Online]. Available: https://www.scien.cx/2020/12/01/the-advent-of-code-blog/. [Accessed: ]
rf:citation
» The Advent of Code [blog] | remy sharp's b:log | Sciencx | https://www.scien.cx/2020/12/01/the-advent-of-code-blog/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.