A fun distraction occurred this week when the following snippet of bash code was suggested in a pull request (simplified for demonstrative clarity):
1if [ echo $VAR1 | grep -q "text" ] || [ $VAR2 -eq 0 ]; then 2 echo "If test passed." 3else 4 echo "If test failed." 5fi Taken at initial face value, it looked like it should work okay. There didn’t appear to be anything immediately wrong with its syntax.
In the previous blog I described why Advent of Code is an awesome and creative way to exercise your programming skills. A few days ago I wrapped up 2019’s problems, although I must admit I needed some serious help (read: reading someone else’s solution) to do Day 22 Part 2.
This year was also the first year that I managed to convince some work colleagues to join me on the AoC train, which made for some fun watercooler discussions in the morning where we could talk about the ways we solved (or got stuck) on the previous day’s problem.
Why AoC? I’ve long wanted to write a blog promoting the merits of Advent of Code and - since it has just wrapped up its fifth year - there seems to be no better time like the present.
Advent of Code (or AoC as I’ll refer to it hereafter) is a solo effort by Eric Wastl. Commencing each year on December 1st, it presents an advent calendar-style series of daily programming challenges in the lead-up to Christmas.