Here is an example of the app with all the functionality implemented except for the timer.after most of exercise 1.
Ex. 1. Randomize. Modify the function randomize in the class table to prevent lines of 3 or more in either direction before the player makes a move. You can implement this whichever way you want, but my suggestion is to initialize the whole table with a non-color value (like -1), then for each generated color, repeat the procedure while you get a match in that position. You can simply use the function from the previous homework for this. With at least 5 colors there should always be a solution and you should not end up with an endless loop.
Ex. 2. Remove Matches. Implement a function, let's call it clearMatches, that check the board and eliminates all existing lines of 3 or more in all directions. You can give this function a starting value for the column and row and assume that you will check form there going up in both coordinates. If the detection and removal functions form the previous homework work, then they are already doing most of the job here. You need to keep in mind that once you eliminate a line of 3, you need to restart the check form the lowest value of the column and row of all the eliminated cells.
Ex. 3. Check For Moves. Write a function that checks for possible moves. This function would have to scan the table once doing horizontal swaps of the colors only and checking for matches on both swapped cells, and then doing the same thing vertically. As soon as you find a possible move, you can return true. If both scans are unsuccessful, you can return false at the end.
Ex. 4. Timer. Add a timer object to the class Table that should delay the operation of setting the tiles back to an idle state or removed when a match has been found. See Timer in ActionScript slides for some references to the Timer class and the diagrams of how to integrate the timer in the gem swap program.
Turn in: the source file .fla, the compiled version .swf, and all the resource files and classes that you create and modify.