This puzzle challenge brings joy to the world of code


At midnight on December 1, 2015, when Eric Wastl first launched his annual Santa-themed puzzle programming challenge. Advent of code, 81 people had signed up. That was pretty much in line with their planning capacity for 70 participants. Wastl thought that this fun might be of interest to some friends, friends of friends, and perhaps some of his friends as well.

But Wastl, a software engineer who works as a senior architect for TCGPlayer, an online marketplace for trading card games, couldn’t anticipate how recursive contagion from social media could exceed these modest expectations. He jokes that the technical term for what happened next is: “OH NO!” In 12 hours there were around 4,000 participants. The server almost crashed. At 48 hours, there were 15,000 people, and at the end of the event, on December 25, the grand total was 52,000. The following year, he moved the operation to Amazon Web Services and since then the numbers have continued to grow.

Last year, perhaps due to the pandemic, the event saw a 50% increase in traffic, with more than 180,000 participants worldwide.

And now, again this year, thousands of programmers from San Francisco to Slovenia, students and software engineers and competitive programmers alike, are counting towards Christmas with Advent of Code (AoC). While traditional Advent calendars offer daily gifts of chocolate or toys (and some alternative versions deliver doggie treats, Jack Daniel’s, Lego figures, or even digital delights through apps), Advent of Coders playfully unwraps math problems and then writes mini-computer programs that are responsible for solving them.

The fun of this, in part, lies simply in the traditional magic of a festive ritual. But it’s also about submitting to pleasant perplexity. Peter Norvig, Google’s director of research, finds it amusing because he trusts the creator, Wastl, “will make my time worthwhile,” similarly, says Norvig, to how New York Times crossword puzzles trust Will. Shortz will do well. for them. “There will be some tricks that will make it interesting,” says Norvig, “but there are limits to how complicated it is.”

The pleasure of coding

At midnight ET (Wastl is based in Buffalo, New York), every night from December 1 to 25, a new puzzle is lit on adventofcode.com, embedded within a cleverly composed narrative of Christmas shenanigans: One player described the story as “a Excuse plot if ever there was such a thing. “

This year’s event got off to a good start when Santa’s elves lost the keys to the sleigh. The first problem set the scene as follows: “You are minding your own business on a ship at sea when the water alarm goes off! You rush to see if you can help. Apparently one of the Elves tripped and accidentally sent the keys to the sled flying into the ocean! “

Fortunately, the Elves had a submarine on hand for such emergencies, and from there the participants embarked on a 25-day underwater search. They try to solve two puzzles a day (the second adds a twist or more difficulty), each of which is worth a star and some praise: “That’s the correct answer! You are a gold star closer to finding the keys to the sleigh. “

Each player earns a star for solving a problem, but if you are the first to get a star, you receive 100 points; if it is second, it receives 99 points; and so on, with 10th place earning a point.

“To save Christmas,” explains the puzzle master, “you will have to collect all fifty stars by December 25.”

santa ascii hat

MS TECH | ADVENT OF THE CODE

The goal of Advent of Code is to solve the puzzles using the programming language of your choice (Python is the most popular). Participants also use strategies by hook or by crook, such as “Excel craze,” as Wastl describes it, or reams of graph paper, and a surprising number solve the puzzles in Minecraft.

But the broader motivation varies from player to player. Some treat it as an annual tune-up of their programming skills; others see it as the perfect opportunity to learn to code or try a new language. José Valim, creator of the Elixir programming language, broadcasts his AoC live solutions on Twitch.

On the top of the world leaderboard, which ranks the 100 players with the highest total score, competitive programmers such as Brian Chen (his name is “betaveros”) and Andrew He (“ecnerwala”) are out of speed. A security software engineer who works in end-to-end encryption At Zoom, Chen ranked first last year (and the year before), while he ranked a close second.

“Going fast is fun,” says Chen, “as is optimizing anything you can get fairly immediate feedback on. There are a lot of little buttons to tweak and a lot of little moments to be proud of where you made the right decision or put together something that was helpful. “

Both MIT computer science alumni living in the Bay Area, Chen and He are friendly rivals who have competed together in programming challenges over the years, on the same team at the International University Programming Competition (ICPC) and as competitors in Codeforces Y Google Code Jam. This year again, Chen is beating He. “To be honest, it’s because he’s a little better than me,” better at various tricks and implementations that optimize speed, “but I don’t like to admit that,” says He, a founding engineer at startup Modal, which builds infrastructure and tools for data teams.

The leaderboard is out of reach for most participants, especially as the puzzles get more difficult by the day. Kathryn Tang, who leads an engineering operations team at Shopify, was ranked 36th on day one and 81st on day three, but she knew her ranking on the rankings wouldn’t last long. “I’m doing this for fun using Google Sheets,” he says.

However, the contest element is replicated, on Shopify and Google and many companies large and small, with private leaderboards as well as dedicated chat channels where players share solutions and comment on problems in autopsies.

“Competitiveness helps engagement,” said engineer Alec Brickner, commenting on a Slack channel at Primer.ai, a natural language processing startup in San Francisco (Brickner has reached the rankings in a couple of days so far).

“Meh,” his colleague Michael Leikam replied. “The reward for me is the pleasure of coding.”

John Bohannon, Primer’s science director, seconded it with an emoji: “SAME.”

Bohannon also loves the silly story that raises the issues, but the plot is of little to no use. “Speed ​​demon solvers completely ignore history, focus on the variables of the problem to solve and just get to it,” he says.

Nora Petrova, a data scientist and engineer in Primer’s London, UK office, is there for the beauty, not the sport: “I love the drama that unfolds in every puzzle,” she says. For example, on the fourth day, a giant squid joined the submarine; wanted to play bingo, of course. The puzzle entry was a random set of 100 bingo boards, and the challenge was to predict the winning board and give it to the squid.

I love it XOR I hate it

Wastl’s main motivation in creating Advent of Code was to help people become better programmers. “Beginners who are just getting started in programming are the people I want to get the most out of,” he says. “The success metric for most people should be ‘How many new things did I learn?’, Not ‘Was I one of the fastest people in the world to solve this puzzle?'”

Russell Helmstedter, a high school teacher at the De Anza Academy of Technology and Arts in Ventura, California, is using Advent of Code to teach Python to his sixth, seventh and eighth graders. They tackled the first two problems together as a class. From a teaching perspective, problems are effective exercises because if you fail, you can simply try again, in the spirit of evidence-based software development.

Helmstedter found that some of his students were a bit overwhelmed with the double challenge – figuring out the problem and coding a machine to solve it – but most embraced the struggle. “I like that it is difficult to do,” said one student in a survey. And another said: “Honestly, there is no problem. I really like how you start to progressively work towards a goal. “Although the ranking of the multiple-choice survey questions” feels “elicited a” Hate “, 41 respondents chose” Like “(to varying degrees) and eight” I love it”.

reindeer ascii

MS TECH | ADVENT OF THE CODE

At the University of Ljubljana in Slovenia, computer scientist Janez Demšar uses AoC problems as a teacher and to hone his own skills (he is on the core team of Orange, an open source machine learning and data visualization toolbox). “I need to practice something regularly, like a violinist playing in an orchestra and teaching something, but he still needs a few small pieces to practice,” he says. “So these are my studies.” Demšar teaches Programming 101 to a diverse group of more than 200 students. “My biggest concern,” he says, “is how to keep those who already know something (or a lot) of programming interested and busy. AoC tasks are great because they require various skills ”, from pure coding to algorithms.

Gregor Kikelj, a third-year college math student, tried Advent of Code for the first time in 2019. He did well enough to land an internship at Comma.ai (working on Openpilot, their software for semi-automatic driving systems. ), since the founder of the company was also competing. And Kikelj improved his grade in the programming course (with another teacher), since each problem solved was worth extra points in the final exam, in addition to extra points for being placed in the classification.

Kikelj (“grekiki”) got up every morning for the puzzle toss at 6am in Slovenia and was ranked 52nd overall, accumulating a total of 23 additional test points. “After that year, they capped the number of points you can receive at 5,” he recalls. But he’s still coming out with the sun to pounce on the puzzle. This year, his best classification, on the fifth day, was 25th; your goal is to stay in the top 100. “We’ll see how it goes as the problems get more difficult,” says Kikelj.

How to qualify

If the leaderboard is your game, the competition is fierce and the daily countdown is key – players wait like a hawk for the puzzle to drop, then click lickety-split to download. Last year, this “giant burst of synchronized traffic in a single second” (as described by Wastl) worried even Amazon’s load balancers.

The Subreddit AoC—One of many communities on the Internet — is full of inside jokes about baseball. how to prevail (with solutions and help threads, as well as self-satire and memes). But perhaps the best resource is Brian Chen’s blog post on “how the leaderboard. “


www.technologyreview.com

Leave a Reply

Your email address will not be published. Required fields are marked *