Every season of Advent of Code so far featured a story around Santa, with the Easter Bunny sometimes making a cameo appearance. On December 5 in The Netherlands, another legendary figure makes an appearance: Sinterklaas. Actually, the modern Santa Claus grew out of traditions surrounding the historical Saint Nicholas of Myra, on which the Dutch figure of Sinterklaas was also based. Anyway, especially on the evening of December 5, people in The Netherlands spend time with friends and family, write poems, wrap presents inside all kinds of handicrafts, and exchange gifts.
What’s the relevance of all this? Well, for some colleagues – and particularly those with children – it means less time being available to solve today‘s challenge. So instead, let’s take a look back one day first.
L(o){2}king(\s)back\2t\1\2day\s4
Asking a colleague on December 3 about his predictions for the puzzle of day 4, he replied:
Also a fearless regex wizard will bundle all their power into one expression to defeat the code of the ancient one. #justsayin #AdventOfCode #XebiaAoC Twitter status by NakedN3rd
My reply was a variation on a famous quote by Jamie Zawinski:
Some people at #XebiaAoC, when confronted with an #AdventOfCode problem, think “I know, I’ll use regular expressions.” Now they have two problems. Twitter Status by jschulenklopper
My colleague only needed to remind me on the Advent of Code puzzle of December 7, 2016, which he solved with a mind-bogglingly regular expression: /([a-z])((?!\1)[a-z])(?=\1)(?=[a-z]<em><a href="([a-z]</em>[[]]){2}">[]</a><em>[a-z]</em>\2\1\2)/
.
Being regularly and expressively pwnd by that, I decided to at least include a regular expression in my solution for day 4, and in the titles in this post.
By the way, in need for an online regular expression tester and debugger? I found RegExr and Regular Expressions 101 very convenient.
Day\s[^012346789]
Today’s challenge built upon the Intcode computer from day 2. Not a problem for colleagues participating from Xebia and XebiaLabs, although I saw a couple of them complaining about the length of today’s puzzle text, the requirement of careful reading, and the time necessary to complete the program. Let’s hope that tomorrow bring a shorter puzzle.
For me, I still need to start solving day 5. I think that I’ll listen to "Mercury" by Bloc Party while doing so – the planet is mentioned in the puzzle text. The reference to Mercury in the song is about the times when the planet appears to rotate in the opposite direction. In some cultures, this retrograde motion is thought to signify difficulties in communication… how very fitting for today’s text.
Advent of Code 2019 Series
- Advent of Code 2019 Has Started – Join In!
- Advent of Code 2019 – Day 2
- Advent of Code: How Excel Made My Day and Saved My Son’s Day Too
- Advent of Code – Day 4: Visualize
- Advent of Code – Day 5: Saintaerkla2s
- Advent of Code – Day 6: How I Got Hooked on AoC
- Advent of Code – Day 7: Share Your Workflow
- Advent of Code – Day 8: How Simple Things Can Be Very Hard for Some People
- Advent of Code – Day 9: How I Started Enjoying Solving Programming Puzzles
- Advent of Code – Day 10: Space Cowboys Shooting Pixels in the Sky
- Advent of Code – Day 11: To Be or Not to Be
- Advent of Code – Day 12: Shooting for the Moon
- Advent of Code – Day 14: Chain Reaction
- Advent of Code – Day 16: Curses
- Advent of Code – Day 17: Vacuuming a Scaffold with the Intcode Program
- How Little Green Men Helped Me Solve a Puzzle
- Advent of Code – Day 20: A Little Bit of Revision
- Advent of Code – Day 21: It’s a Marathon, Not a Sprint
- Advent of Code – Day 22: Shuffling Cards Until Eternity
- Advent of Code – Day 23: The Network is Reliable
- Advent of Code – Day 24 & 25: Think Out of the Box