Homework #3: Game Playing
Specifications Due: October 8th
Full Program Due: October 24th, 2007
The written part is due at the beginning of class on 10/8. The program should be submitted online by 2:15 on 10/24 to courseworks using the submission instructions.
For this assignment you are to write a program that can play
Connect-Four. You can assume that you are playing against one other opponent. Your opponent can be either a human or a computer
In traditional Connect 4, the board is 7 columns by 6 rows. We deviate from the traditional game in two ways:
Strategy: There is some strategy to playing Connect 4. The websites linked below
have information on strategy and you are welcome to search the web to find other tips on strategies. Note that you can undoubtedly find code online for the traditional version of Connect 4.
It is quite likely that code will be more complicated than what you are required to implement for the assignment. While it is OK to look for strategies online, copying code that you find online will be considered cheating.
Websites:
Rules of Connect4 and links to strategies
You can play Connect 4 with a computer here.
The README file should include:
Tournament: Following the due date, there will be a tournament in which your programs will be pitted against each other. Entering the tournament is optional; everyone entering the tournament will receive 10 points of extra credit and there will be a series of extra credits for teams that win at each round.
Interface:
Since this is a two-player game, you will need to be able to pit your program against a human player (for development and testing) and
against other computer players for the tournament. To facilitate this, we are providing a module that you will
need to interface with. This module will maintain the state of the game, make your moves, report your opponent's moves to you and provide a GUI for the game.
Details can be found on this page: Connect4.
You must write all your code in Java. Code written in other languages will not be accepted. Your code should be compatible with Java 1.5 or higher. It should run on CS machines (currently using Java v1.5.0_01) or, if you don't have CS accounts, on CUNIX (currently using Java v1.6.0_02).
The write-ups may be handwritten or printed and should be turned in at the beginning of class on the day of the deadline.
Softcopy write-ups should be provided as plain-text files or PDF documents. Other formats will not be accepted.
As per the late policy of the class, you will lose 1.5 points (5%) per day that the assignment is submitted past the deadline. For this purpose, any amount of time greater than one minute counts as a full day. Assignments will not be accepted after a period of 7 days beyond the deadline. A further extension may be granted if and only if the instructor is contacted before the end of the 7-day late period, provided that the circumstances are extreme enough to warrant an extension. In this case, the late penalty will be determined on the basis of the individual case. If a request for an extension is not granted before the end of the 7-day period, the assignment will not be accepted under any circumstances.
You are required to submit working and documented code for assignments involving programming. If we have to edit your code in any way in order to get it to run, you will be penalized depending on the extent of the changes required. If we are unable to run your code, we will ask you to uncover the problem and you will be penalized depending on the changes as well as the amount of time taken to fix the code. Penalties for non-working code will be applied in the form of a percentage of the points carried by the assignment part in question.
Write-ups turned in on paper are due at the beginning of the class on the day of the deadline.
Hardcopy write-ups turned in at the end of class will be penalized by 1 point.
Make sure that the source code is clear and well-documented internally as hand annotations will be ignored. The source code must also outline how it should be tested. Clear programming style and thorough testing will account for a substantial portion of your grade for the programming part of this assignment.
Sharing and re-using ideas, solutions and code with other students is prohibited. Please refer to the Collaboration policy page if you have any questions regarding the level of discussion permitted.
Refer to the Submissions page of the class website for specific instructions regarding assignment submissions. Please do not email assignments to any of the TAs.