
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

April 9, 2008
In this assignment, we are going to implement a game, Tic-Tac-Toe, using the game tree you built in class (Lab Exercise 12). A template of the Tic-Tac-Toe is provided on the course website. The given Java Code is adopted from the following website:
http://www.dreamincode.net/forums/showtopic21423.htm
This template provides a GUI for playing the Tic-Tac-Toe with two players. Your task is introducing the game tree in the template such that computer can simulate one of the players and play the game with you. More specifically, you should make computer to decide its best movement based on the game tree.
The structure of the given template is shown as follows:
public TicTacToe() { … This is the constructor of the TicTacToe class for creating the GUI … }
public void actionPerformed(ActionEvent e) { … // Get input from users … // Check whether any user wins the game }
public static void main(String[] args) { … The main method for creating an instance of TicTacToe … }
For this assignment, you just need to change the actionPerformed() method such that the structure following method takes input from both users and check if any user wins the game.
( Two-page report is required)