Practice with inheritance. Continued practice implementing a Graphical User Interface (GUI), including event-driven programming. Continued practice with interfaces and implementing them.
LinearLightsOut is a one-player game (puzzle). Initially, the user is presented with an array of buttons that are randomly initialized to either Xs or Os, 50% probability each. Clicking on a button changes the symbol of the button and both its left and right neighbors.
The object of the game is to reach a state where the buttons all show the same symbol, whether Xs or Os doesn’t matter. The pictures on the right show a game at the start (with buttons set randomly), a game that has been won (with a “We have a winner!” message displayed in the title), and (just for grins) a game in progress on a Mac. |
|
JButton
.
Remember to ask for help if you get stuck.
Here are the stages you should use to implement the project:
Hints:
setText()
and getText()
methods of JButton
are your friends.
Remember, in all your code:
Here is the grading rubric for this assignment. |
Turn in your programming work by committing it to your SVN repository for this project.