The latest issue of the PracTeX Journal (discl.: I used to be a production editor there some years back) contains a set of interesting challenges: typeset and solve a KenKen puzzle. I haven’t seen this puzzle before; it looks fun for those of you who like this sort of thing. I encourage all with the time to attempt at least some of the problem—it looks fun!
In 2008 TPJ issued a similar challenge for Sudoku. At the time I didn’t think anyone would implement a complete Sudoku solution in TeX but I was astonished and happily surprised when two solutions were forthcoming.
It’s good to remember that almost anything can be done in TeX macros if one tries hard enough. In this theme, my favourite example of ‘why not?’ when it comes to theoretically-possible but rather-quite-difficult problem solving in TeX is from the late Michael Downes’ series of ‘Around the Bend’ problems. (Peter Wilson created a wonderfully typeset version available, in a TeX Live distribution at least, via ‘
texdoc AroundTheBend’.) See chapters 10 and 11:
Using as few lines of TeX code as possible, set up an Around the Bend post containing a typical exercise so that it can be processed by plain TeX to (a) skip over the exercise text and (b) decode an embedded encoded answer.
It’s a fascinating idea to encode and decode text in TeX itself (of course with LuaTeX around now such ‘problems’ are little more than academic); as far as I know, however, such tools were never exploited for robust text passing to/from other formats. (E.g., inside PDF metadata where data should be encoded correctly.)
And surely everyone reading this has seen David Carlisle’s
xii.tex before, right?