Last weekend, I went to HackCambridge with Petr to hack on things. Some things could be organized a bit better (like the WiFi at the main venue being hilariously broken), but we ended up having a lot of fun. Luckily, a bunch of my homies from Dropbox also happen to study in Cambridge and it was great to catch up with them.
We built a cool game. It’s called The Deadlock Empire and it lets you slay dragons and learn concurrency - what could me more awesome?!?!
Just look at this presentation!
It’s at https://deadlockempire.github.io. You can laugh at our poor coding practices on GitHub (deadlockempire/deadlockempire.github.io).
The Deadlock Empire has a sequence of challenges for practicing concurrent thinking. Each challenge gives you several threads, each running their own source code in C#, and your objective is to play the mischievous Scheduler: take seemingly-innocent parallel code and run it so that it breaks.
You can step each thread line-by-line (and undo your steps), and some
non-atomic instructions can be expanded into atomic parts (i.e.,
i = i + 1
translates to a separate load and store). Sometimes, you have to do this to
properly crack the challenges, like in
Tutorial 2: Non-Atomic Instructions.
If you feel bored by how simple the first challenges are, scroll down a bit. The Deadlock Empire quest at the bottom should keep you busy for a while :)
I think it took us around 18 hours of actual work to write The Deadlock Empire: both of us had a bit of shut-eye early morning and we didn’t have enough time by the end to start working on the really ambitious features, so the last few hours were just a commit here and there, fixing up a font or an obscure bug.
In the upcoming days, we’ll add more synchronization primitives and polish the experience. We want this game to be more fun, educational and useful.
I now have a favorite bookstore. Next door from their regular store, Cambridge University Press sells their damaged books. (Even through the only damage I found on them was the red ‘DAMAGED’ stamp at the front page.) Awesome books on advanced mathematics and CS, philosophy, sociology, biology. For 3 pounds a paperback or 7 pounds a hardcover. People grab them by the stack. Note to self: bring big suitcase next time.
WE WON THE HACKATHON!!! HOOORAY!!!!1111
We also won the Best Hack in Gaming/VR award (judged by Improbable) and Bloomberg’s Favorite Hack.