Last week I participated in the Escape from /dev/null competition, a game created by Peter Svensson and organized in Bucharest with the help Google. I wrote a React client before the game and used it in a hardcore dungeon where the only way to escape was by using algorithms.

I found about the competition in an email sent on the ROSEdu mailing list. I tried to research on the web more about the competition, but did not find a lot of details. Two weeks before the contest, I got a confirmation email that contained an API documentation. The advice in the email was to build our own client so we can use it during the competition.

At work, we've been using React for a while. It's an awesome framework by Facebook that has made the life of programmers who build web user interfaces much simpler. To do this, it has borrowed some concepts from distributed systems and some other from graphic rendering. If you want to learn more about it watch this talk from the Strange Loop conference.

User interface of the game. The retro design was obtained by using only ASCII characters. The game is meant to be played with the developer tools open. Here I am in the first level, slashing a random monster.
I built the client in two days and I can really say that it is a pleasure to write code with React. One thing I thought it would give me a slight advantage over the other competitors was that I was dumping all the map into the local storage of the browser. So, if your character died or the connection would drop, you always had the discovered map saved. You can read more about the features and see the code in the repo.

Game Day

We were about 50 participants in Impact Hub Bucharest. When we arrived, we logged in the interface of the actual game.

The nodes in the graph are the challenges. Till the 17th node, these were basic Computer Science or software engineering questions. From there, all the challenges involved making an algorithm that moved your character in the dungeon. I can't disclose what the actual challenges are, but you have to implement some backtracking, graph search or other fancy algorithms. In the end, I made another client in Python using the awesome Requests library, and only used my React client to see the moves of the character in the dungeon.
Me, arguing w/ a Googler if my solution is fast enough.
There were some problems with the game server. Peter was hosting it on a VPS in Sweden and we were allowed to do a max of 20 requests/sec. So, the game crashed a lot in the beginning because it could not handle the load. We then waited about 2 hours till he downloaded the game on his laptop and ran it locally from there.
Hackers hacking hacks
The prizes from Google were bigger as the level was harder. I managed to finish challenges 17 and 18, then skipped 19 because I wanted to win a Chromecast at challenge 20. However, it was too difficult for me to get it done in 2 hours, so I finished 3rd, on par with other 4 participants. Second place went to Paul, because he was the only pragmatic guy in the room to take the challenges in order. First place went to Vali which came with on of the biggest hacks I've ever seen. He wrote a bad complexity algorithm, but used a 64GB of RAM and 20 core VPS to make it seem like it was running smoothly.
Vali showing us how his Redis + MQTT hack worked.
Except for the small hiccups with the server in the beginning, the organisation was flawless. We had the best food I've ever eaten at a hacking event. After the contest, we went to a nearby restaurant and talked with the Googlers that attended the event. It was really fun to seeing engineers argue what tool is more important internally, Dremel vs Spanner.