Unbounded Tic-Tac-Toe

Here is the result of a few nights’ worth of hacking. This project was originally my solution to an exercise I had posed to my functional programming students. Since then, I’ve rewritten it once and redesigned the user interface completely.

It’s an idealized implementation of a game we used to play during breaks at school. We would take a sheet of cross-ruled paper and play tic-tac-toe, with the following two changes: the whole sheet was allowed as the board, and we required a sequence of five, not three, marks for a win. The ideal was that the “board” was infinite, or unbounded, though in practice we did take the paper’s edges as the board’s bounds. (We also usually played more than one game on the same sheet of paper; previous games were simply declared “no-man’s land”, effectively creating weirdly shaped “holes” in the game board; I haven’t duplicated that here.)

Version 1.1 implements a single-player mode (the other player is simulated) and a demo mode (the program simulates both players). It’s written in Haskell, and requires gtk2hs 0.9.10 (or later) with Cairo enabled, and GTK+ 2.8 (or later). The source is available as release tarballs and as a darcs repository.

(Yes, I know that the arrow in the lower-left corner is wrong. That’s not my bug, though.)

8 thoughts on “Unbounded Tic-Tac-Toe”

  1. Gomoku and other similar games have a bounded board. I have no idea if unboundedness changes the theoretical properties of the game, but it does prevent certain tactics that exploit the board bounds. (Those tactics were occasionally used in our games, but they were frowned upon.)

    At our school we just called it “jätkänshakki” (logger’s chess), but it was understood that this usage was nonstandard, as the word properly refers only to the canonical 3×3 variant (the canonical tic-tac-toe).

  2. It is known (and proved) that the player goes first will win with perfect play on a 15×15 board without additional rules, and I doubt much of that has to do with the boundary of borad.

    In the professional version of Gomoku, Renju, there are quite several complicated rules to reduce the advantage of going first.

  3. I know of the proof, but haven’t seen it. Whether it generalizes to an unbounded board depends on whether it constructs a perfect game without touching the borders or not. In the classical case of canonical tic-tac-toe, the winning strategy depends on filling the board so that there is no more room for winning straights. Obviously, that cannot be done when the board is unbounded

  4. The font/arrow bug looks surprisingly similar to one I filed a while back (Deb#275759, which appears to have been closed but not actually fixed). Funny how many bugs in fonts one runs across, huh?

    Too bad the font-editing tools are impossible to use, or I’d go fix them myself.

Leave a Reply

Your email address will not be published. Required fields are marked *