Due Thursday, April 22 at 11:59 PM via e-mail to BOTH vrastogi at u.northwestern.edu and ddowney at eecs.northwestern.edu. Use EECS 348 Homework 2 as the e-mail subject line. PDF format required. LATE ASSIGNMENTS WILL NOT BE GRADED.
There are lots of ways to design your program, and here's a summary of how I might
do so (it's okay if you do something else). I'd work in an object-oriented language and create a Board class (which would store the game state and implement the successor function) and Player class, with
subtypes of HumanPlayer (a simple command-line interface) and ComputerPlayer (an
implementation of Minimax and Alpha-Beta pruning). I'd probably put the evaluation function in
the Board class too, though I could see arguments for putting it elsewhere.
Minimax and Alpha-Beta pruning can be somewhat tricky to implement and debug. The reason we're starting with Tic-Tac-Toe is so teams can test their code on easy-to-understand examples.
It will probably be helpful if you include test code to set your board to a particular state (i.e., one
in which you know what Minimax should do) and check that the computer player returns the
right moves.
Relevant Reading
Chapter 5, Sections 5.1 to 5.3.
Assignment
This assignment will be performed in teams of two to four, formed according to the
348 team-forming guidelines. The code for this assignment and the following one will be written by the team; however, each student must turn in their own homework write-up, so each team member is responsible for understanding all key pieces of the code (question 2 below) and for running the code (question 1b).
Implementation Guidelines
You can use whichever programming language you like. Remember that a modular design for your
Tic-Tac-Toe program will be helpful when you modify the code to play Othello. Thus, if you're careful
about design, it will help you in answering question 3 above and make Homework #3 substantially easier.