Java Assignment 7 -- Lights Out

This assignment asks you to write an applet for the game "Lights Out". Imagine that your job is managing at a power plant in Los Angeles. It is a hot summer night and a brown-out has hit the entire city leaving millions of people in darkness. You need to turn all the lights back on as quickly as possible. Hooking up gas generators in each of the major areas of the city should do the trick, however the generators are a bit tricky when it comes to powering an entire city. One generator can power 5 city blocks: one central block, and one block each in the north, south, east, and west directions. However, if two generators try to power the same city block, they short out. In order to win the game you must turn all the lights for every block in the city.

Program requirements

Your lights out game must have at least a 5 x 5 grid that uses an array of buttons. (Look at the example of one way to handle an array of buttons on the website.)

Extensions

If you have extra time, you may want to add features to your applet to make it more challenging. Here's a lights out game with different levels of difficulty. Another idea to make the game more challenging is to start with a different randomly lit buttons. Be warned that not all arrangements are solvable!

There is a good web page that explains The mathematics of the Lights Out Puzzle. (The field of math that is used to solve the Lights Out puzzle is called "linear algebra").

You will need a web page to display your applet. Your homepage should have a link to the web page for this assignment.

Submit the URL of your applet along with your Java code (the .java file(s)) in an email message to mrsimon@lycos.com.