| EIW Fall 2003 HW2: JavaScript Tic-Tac-Toe Board |
| EIW Home | HW2 FAQ |
You may work with a single partner on HW#2. You may not share code in any form with anyone other than your partner! Feel free to get ideas from sample JavaScript you can find on the WWW, but DO NOT submit code that you did not write. Submitting code you find on the web is a violation of the course policy on academic integrity and will result in (at a minimum) a zero for HW2 and a 2 letter grade drop for the course.
You need to create an HTML document (that includes JavaScript) that allows two people (sitting at the same computer) to play Tic-Tac-Toe. Your system must provide the following:
Start a new game at any time (by pressing a button or some similar action)
Enforce the rules. This can be as simple as keeping track of whose turn it is, so the players don't have a choice of whether to put an X or an O on the board - simply clicking on a blank square will change the square according to whose turn it is. X always goes first.
Make sure that players cannot cheat - the only legal moves are empty spaces on the board (you can't put an X on a space that already has an O).
Recognize when someone has won (and pop up an alert to let the players know). It must not be possible to make moves after someone has already won without starting a new game.
Recognize when the game is a draw (9 moves and no winner).
You are not being asked to write a JavaScript Tic-Tac-Toe playing program, the game is played by humans, your code just provides the board and enforces the rules.
Below are some screen captures of my game.



Homework submission will be done via WebCT (webct.rpi.edu).
Once you log in to WebCT and go to the EIW WebCT page, you need
to click on assignments and then select
hw2. You should upload all the files necessary for
your game, if you use images you need to make sure you include
these files.
IMPORTANT: Make sure that your name appears prominently on your tic-tac-toe game page (when displayed in a browser). If you work with a partner, make sure both of your names appear on the page.
There should only be one submission per team, so if you work with someone else only one of you should submit.
You can modify your submission on WebCT as often as you like, up until the deadline. Any files submitted/changed after the deadline are considered late. The late penalty is 10%/day up to a maximum of 7 days late. Nothing will be accepted 7 days after the due date.
Your grade depends on how well your system works, and on how well can understand your code (make sure you make the javascript human-readable! indent your code! comment your code!). The assignment of grades will follow the following formula:
| Supports basic game play (users can make moves, board is displayed correctly, etc) | 40% |
| Game enforces rules and can detect win/draw | 40% |
| Code read-ability. How well can we read your code, how hard would it be to make small changes, etc. | 20% |
| EIW Fall 2003 |