WebSys Fall 2006     HW2: JavaScript Lights Out


HW2 is Due Oct 4th by 11:59PM
Submit to WebCT dropbox HW2

You need to create an HTML document (that includes JavaScript) that provides a Lights Out game. Lights Out is a puzzle played on a square grid, in which the object it to get all the grid cells to be a specific color. The traditional puzzle is played on a 5x5 grid, your submission must allow the user to choose any size 4-10 (inclusive).

Note: You are not being asked to write javascript that can solve this puzzle, just provide a web page in which the user can play the puzzle. All puzzle functionality must be provided by javascript (no Java applets, flash, etc).

For general information about Lights Out, online versions, mathematical background, etc - refer to the following:

There are a number of JavaScript implementations of the game you may find on the Web. Feel free to get ideas from these, but you must write every line of the code you submit. It is not acceptable that your code is based on someone else's code (including any of the versions you find online). I have a number of tools that can detect similarities between programs and will be using them to catch this. Minimum penalty is a 0 on the assignment and a 2 letter grade drop for your final grade. I am the world authority on catching cheaters, author of a book and many articles on catching cheaters, I do this for fun...


Your submission (HTML document) must provide the following:

Implementation and UI Notes

You decide how the user makes moves. You can capture keyboard events with onKeyPress, or have the user use the mouse - anything is fine (although it must be easy to understand how to make moves!).

You should definitely be using CSS!

Feel free to put CSS and/or Javascript in separate files that are referenced from your HTML file. Make sure you submit them all!

What to submit and how to submit

You need to submit your HTML file to the WebCT dropbox labeled "hw2". If your page references any images, javascript or css files, you must also submit those files, and your HTML document must use relative URLs!. We will be viewing your submissions on our machines, not on yours, so if you have something like the image tag shown below we won't see your images and you will lose points!:

<img src="file://c:/eiw/blah.gif">
WebSys Fall 2006