27 January 2009

Tic-Tac-Tec-Toc-Toe

tic-tac-toe 5-in-a-row Brian KlugTic-Tac-Tec-Toc-Toe, get five in a row. Metadeb tipped me to this variation of Tic-Tac-Toe. It uses a larger board and the object is to get five in a row. I'm pretty sure I've played this on paper versus other people before, but I don't recall when.




I wanted to give proper credit for this online creation, so I contacted the site owner and he was kind enough to respond:

tic-tac-toe 5-in-a-row Brian KlugBrian writes:
You may credit to me, Brian Klug - thanks so much.

It was written for AI class at UMD. Each move, it plays "what-if" by looking at each square as its next move. There are a bunch of heuristics. There are some obvious ones, like, "does moving here make 5-in-a-row", "does this block a winning move by player", the total points earned if you would assign points to total number of pieces in a row (i.e. it will favor a square that makes TWO lines of four squares, i.e. if it formed a cross.). Finally, it also prefers to play the center of the board.

Cheers!


tic-tac-toe 5-in-a-row Brian Klug heuristicsEven these simple rules are enough for the computer to play a decent game, and it beat me on my first try. A bit of thought and a better defense and I am able to beat it regularly. Like the simpler 3-by-3 version of Tic-tac-toe, moving first is an advantage, but it is not clear in the extended version if there is always a play-to-draw strategy for the second moving player. My intuition is that on the expanded board the number of possible moves to be blocked grows more quickly than than the opportunity to block them, and so playing to a draw is much more difficult.

No comments: