Pandiculator Remembers His Password

I suspect I’m far from unique in having thought about QR codes as a possibly useful tool for a thematic crossword. That said, trying to make a crossword that doubled as a QR code initially seemed like a lost cause. After all, the smallest possible normal QR code is 21×21 pixels – too large!

Still, after seeing that there were no QR-themed puzzles in Dave Henning’s Crossword Database, it felt like an idea worth pursuing. It turns out that there is such a thing as a Micro QR code which, with only one corner containing the typical QR code nested squares, coming in at a comparatively svelte 11×11 pixels. On the face of it this seemed promising, until I pointed my phone camera at one and it didn’t decode (while most modern phones will instantly decode QR codes in their default camera app). Sure, there are apps that will decode any of these weird and wonderful 2D barcode formats, but requiring something a bit specialist like that seemed deeply unsatisfactory, perhaps unacceptable to editors too. Similarly, the “Data Matrix” format that Royal Mail’s stamps now use sits in that grey area of being pretty ubiquitous yet non-trivial to decode.

The eureka moment came while looking at a 21×21 QR code and realizing that, once you remove the nested squares, you’re left with a barred crossword lover’s dream: a 13×13 grid in the bottom-right where most of the data resides. The remaining strips between the nested squares could likely be addressed in a different way, perhaps as part of a supplementary puzzle. I didn’t want to include them in the initial grid, as the odd-shaped 21×21 grid with three missing corners would have given the game away too early. In the end, after coming up with the admittedly silly “forgotten password” idea, it seemed possible to just provide some words on squared paper, which hopefully prevented the puzzle from becoming overly lengthy.

While we’re at least vaguely on the topic of QR code anatomy, perhaps it’s worth noting that the QR code standard, in addition to having error-correcting codes (to allow for dodgy lighting levels, poor cameras, bad printing and so on), allows for custom padding bytes. I didn’t use them in the puzzle as adding padding tends to make the grid even bigger, but it’s maybe something cool that I don’t think many are aware of. Sometimes you’ll see a QR code with a logo stuck in the middle – those usually rely on error correction to “fill in the gap” that they obscure. Custom padding bytes, on the other hand, let you control some pixels while maintaining perfectly valid error correction. For instance, this one says “Magpie” (admittedly in a rather low-res font) in the middle:

Here, blue is the actual data for the content, green is padding bytes and bits, red is the error-correcting code, grey is formatting/control and black/white are the fixed pixels in a QR code of this size. I should probably credit revk’s excellent QR code C library for making the above.

Anyhow, back to the puzzle. QXW did most of the hard work of grid construction for me. That said, constraining each letter of a grid to one half of the alphabet or another while maintaining symmetry is quite limiting (thankfully I wasn’t doing a Twin and try doing the same with the clues!), so it took a fair amount of tinkering with different barrings – a process that I still find leans too much on trial and error than some deeper strategy for me – if anyone has any pro tips on how to make barring a puzzle more algorithmic then I’m all ears. In any case, the error-correcting nature of QR codes meant that I should in theory have a letter or two’s extra degree of freedom in toggling a square’s colour without making the whole thing undecodable (I seem to remember I did actually take advantage of this for one letter in the puzzle to achieve a gridfill – may as well use an advantage of the theme)! The QR code I’d started with forced some early barrings. Eventually I reached something I was fairly happy with grid-wise and then it was just a case of writing the clues. Hopefully doing the shading to construct the QR wasn’t too tedious – apologies if it was as this was always going to be the experiential low point for the solver!

I see from the comments on the Solutions document that some were concerned about what exactly should be submitted. I’m sure the original preamble that Pandiculator misplaced made that perfectly clear(!) My initial intention had been for just the password to be submitted, which would have the added advantage of making the marking job easier. However, it’d probably still decode just fine with a couple of wrong letters in unches, which is perhaps a little too lax for the Magpie. Anyway, I’m sure anything sensible will marked as correct, given the near non-existent preamble that the ruse demanded.

Writing this puzzle brought the additional advantage that if I ever forget my actual Magpie password, I can deem it thematically appropriate!

Leave a Reply

You must be logged in to post a comment.