Project 7

Your problem is to design and implement a program displaying and managing a tic-tac-toe board. There is such a project discussed in the textbook, in the section on applets, but this is a considerably simpler version, so the textbook discussion may not be of much help.

The intention is not to have the computer play the game, but simply to design a board to record the moves between two human players. The display should show 9 button objects, in the usual arrangement. Initially each is blank. The first person to move clicks a position (button) and that displays an X. The second person to move clicks a position (button) and that displays an O, and so on, alternating. Things should be arranged so that no move can be entered at a position that already records a move.

This project will be discussed further in class.

Solution