Logic Programming

Assignment - Game State

Nine Board Tic Tac Toe is a variant of Tic Tac Toe played on nine boards arranged in a 3x3 grid. The first player can place his mark on any square of any board; all moves thereafter are placed in empty spaces on the board corresponding to the square of the previous move. For example, if a mark is placed in the upper-left square of a board, the next mark must be placed in an open square of the upper-left board. If a player cannot move because the indicated board is full, the next move may go on any board. Victory is attained by getting three in a row on any board. This game is considerably longer and more involved than Tic Tac Toe, with a definite opening, middle game, and endgame.

A sample state of the game is pictured below. As you can see, the X and O players have each made several plays. It is X's turn to play, and the next play must take place in the middle board on the left.

In this assignment and the assignments that follow, your job is to develop various components of a logic program to manage matches of this game. Your program should eventually present states using visual displays (like the one above), it should provide the users with the ability to make moves, it should simulate moves in the game, and it should provide an automated opponent against which to play.

Your assignment this week is just the first step. Your job here is to design a vocabulary to represent states of this game and to use this vocabulary to build a dataset representing the state pictured above.

Submission details: When you are done, head to Gradescope to submit an English language description of your state vocabulary (symbols, constructors, and predicates with types and arities and their intended meaning) and a dataset describing the state of the game pictured above in your chosen vocabulary.