Prog 4: GridMatch

Write a program to display a 5 x 5 grid of small colored squares.  Clicking with the mouse on any squares that is part of a group of 3 or more of the same color will make all of those squares disappear, with the ones above it sliding down.  Each square on the board must be randomly initialized to one of 4 colors.  Selecting the "Reset" button should again randomize all the board square colors.  Selecting the "Exit" button should exit the program.  The console window should display identifying information (name, date, etc.) as well as a summary of what is working and what is not working in your program.

Related sample code to get started can be found here, which are the solution files from the Spring 2011 Program #3 called Square-Up, which has many similarities.  The big difference is that you must use arrays in this program.

Notes & Grading:

Extra Credit:

(5 points) Once all playable configurations have been selected on a board with n squares per side, have your program automatically refresh, except this time with n+2 squares per side.

(5 more points) If an entire column is left blank, have the squares to the right of it slide left to fill in.  For example, if we started with:

           and then clicked on any one of the middle "gray" squares, then all those connected gray squares would be eliminated, leaving:

          

If the blank column is eliminated, that would leave: