You're reading: cp's mathem-o-blog

This island is big enough for the both of us

I’ve made a little game.

Screens of the intro to the game. Text reads "This island is big enough for the both of us, but we don't want to be together. We'll divide it up between us by digging two squares at a time. Our islands will be odd sizes, and less than 10 squares each. Most squares wins!"

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.

(will not be published)

$\LaTeX$: You can use LaTeX in your comments. e.g. $ e^{\pi i} $ for inline maths; \[ e^{\pi i} \] for display-mode (on its own line) maths.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>