I’ve made a little game.
David Butler, of the Maths Learning Centre at the University of Adelaide, runs an event called One Hundred Factorial. He invites anyone passing by the MLC to join in with maths games and puzzles. David often tweets about what happens at One Hundred Factorial. It seems lovely, and the tweets always make me wish I could join in too.
A couple of weeks ago, I think partly prompted by the imminent arrival of a new lockdown in Australia, David decided to run a virtual One Hundred Factorial session at a time that would be convenient for people in the UK and USA. I signed up immediately!
I had a lovely time, chatting to David in real-time for the first time, and meeting a few other of David’s fans, who’d come to play.
One of the games that David had prepared was called Imparium. I’ve since found out it was invented by Walter Joris, a Belgian artist and prolific inventor of games.
There’s a nice interview with Walter by Ben Orlin. Ben is writing a book about mathematical games, which I’m going to buy as soon as it’s ready!
Here’s a brief version of the rules: you start with a 6×6 grid of boxes. You and another player take turns removing pairs of adjacent boxes. Whenever there’s a group made up of an odd number less than 10 contiguous boxes, the last player to move can claim them. Once all boxes have been either claimed or removed, the game is over and the person who has claimed the most boxes wins.
David had set up a board on the virtual canvas miro.io for the virtual One Hundred Factorial session, and we played Imparium by setting up a grid of square blocks, and to take a turn you had to drag some blocks out of the way. It worked quite well, but because the Miro interface isn’t designed for games we quite often made mistakes like moving too many pieces, or accidentally losing pieces underneath other bits of the canvas.
This seemed like a nice opportunity to make another interactive maths thing. I set about coding up the game’s rules in Elm, a nice programming language I’ve used in the past for things like this.
Once I’d got the basics of the game working, I thought about how to present it. Walter Joris’s original version of the game has you filling in boxes on a paper grid. David’s version involved moving boxes out of the way. I thought that the remaining pieces that are claimed by each player look like islands, so I came up with the idea that the players are trying to divide up a big island between each other, but they can only do it destructively, by digging out rivers and coastlines.
I think this works quite well: it justifies the odd-size rule, because an even-sized island can still be shared fairly between the two players.
Before the start of the game, I made a short and whimsical explanation of the rules. The condition for claiming islands is quite tricky to state succinctly, but showing some islands as they’d appear in the game alongside the text makes it much clearer.
You can play the game on my website. If you’re interested in seeing the source code, it’s on GitHub.