Honors Programming Assignment 2

Computer Science 102

Spring 2007 Using a GUI to display a maze and solving it by recursive back-tracking

Part A Due Date: WED MAR 21, 11:59 pm

Part B Due Date: SUN MAR 25, 11:59 pm

Part a

Use the maze in the following link to generate a maze with blue and white buttons, where the blue ones represent the walls and the white ones, the possible path. Solve the maze in a depth-first fashion as shown in class. Number the buttons consecutively as you numbered the cells in the first honors assignment. Then use a button listener to drive the movement of the tile on the direct path to the exit, coloring the tiles pink as you go. The only moves allowed are N, E, S, snd W.

Part b


Getting the pause to work is tricky. You have to have a separate thread for the trace process and one for the retrace process. Nest these in the if statements detecting an action in the actionPerformed() method. As an alternative, you can drive the progression of the buttons down the path by clicking the appropriate button.

Samuel Marateck
WED FEB 28 22:23:14 EST 2007