Hanabi is a card game that my friends and I have recently gotten into. It’s cooperative and you hold your cards face out, so you can see everyone else’s cards but your own. As a team, you’re trying to communicate the best plays to each other, although the game limits how much you can say.
I’ve come up with a Hanabi strategy for the five player game that is somewhat complicated, but I suspect is capable of winning nearly all of the time. It’s complicated enough that I won’t try to explain it here (I’m not even going to explain the game). It’s also deterministic, and not computationally difficult—it’s at least conceivable that humans could play it, although it’d take practice to learn.
So of course I decided it’d just be easier to program the computer to play it. Now I’m one long weekend and 500 lines deep, and I haven’t managed to win a game yet. I’ve learned a lot in the process—I previously hadn’t done any object oriented programming in Go, and now I feel like a master of interfaces.
I’ve also come to appreciate just how smart humans are. One aspect of my strategy involves expecting another player to take a particular action, and then adjusting one’s own plan if they don’t. That sentence took 23 words, and 138 characters. It could be a tweet. I haven’t even started to figure out how I should implement it. (Actually, now that I write this, I think I know what to do.)
Anyway, if you want to know more, my code is on Github.