CS 242 Fall 2009 : Assignment 2.4 | charlie on software

CS 242 Fall 2009 : Assignment 2.4

This page last changed on Oct 13, 2009 by celliso2.

Assignment 2.4 – Creating a GUI for our library

This final part of the assignment will be due on October 14th, 2009 at 8AM in svn. This assignment will be an extension of the maze solver library. Specifically, it will create a GUI interface for your libraries. Please commit your assignment to a directory called Assignment2.4 in svn. Please match this spelling exactly so we can automate the export of code for code reading.


For this assignment we will be building a Graphical User Interface (GUI) for the maze solving libraries we have developed. As a method of creating this GUI, we’ll be turning to the model-view-controller (MVC) software architecture. In an MVC architecture there are three components that comprise all the pieces of a GUI. The Model is used to hold data related to an application. In the context of this assignment, this might be the maze representation(s), state of the solution, state of the GUI, etc. The View component contains what the user will see. A view would have all buttons, labels, frames, pictures, and other graphical elements. The Controller handles communication between the user and the application. It will contain the functions to handle button clicks, for example. The following link is an excellent description of the MVC design paradigm: http://www.cs.rice.edu/~cork/newBook/node89.html.

To complete this assignment, your GUI must do several things. It should contain a button to test if the maze is solvable. It should contain a button to then solve the maze. The GUI should be able to load a maze from a file, and it should not need to be restarted when new mazes are loaded. You will find this functionality to be easily performed with a File Chooser. It should also contain a visualization of the maze, and when solved, the solution. This visualization can be a minimum of a text box, but other graphical displays are just fine. Either way, the display must be embedded in the GUI (command-line output does not count). Your GUI should also be able to take in any parameters used for scaling uphill/downhill values or otherwise changing the heuristic or cost functions.

Your GUI should also be able to set up a range for coefficients for your heuristic, take an interval for running successive tries and allow for running for each of the values in the given ranges. You should also allow for “stepping” through runs. Lastly, your UI should be able to allow for basic editing of the map, that is, set values in a given range to “no walk”.

You may also complete some challenge requirements to earn some extra credit. Eligible challenge requirements include: editing a maze from the GUI beyond the basic requirement (set values in ranges to specific values?), or animating the maze solution with an adjustable time interval. If you have another challenge idea, post it on the newsgroup and one of the course staff will let you know if it is acceptable.


As always, you will be graded on participation and implementing the guidelines for modular, readable code. Additionally, you will be graded on the following criteria.

  1. Create a GUI using the Model/View/Controller design scheme.
  2. GUI Can load a maze from a file.
  3. GUI Contains a visualization of the maze.
  4. Solve button solves the maze and visualizes the solution path.
  5. GUI has inputs for any parameters.
    1. These include the costs and weights used in A*
  6. GUI can run successive path finds over ranges supplied
  7. GUI allows for basic editing of mazes
  8. GUI can “step” through runs


Consider the requirements below for additional features of your GUI:

  1. Add the ability to edit a maze beyond the basic requirement
  2. Animate the maze solution with an adjustable time interval.
  3. Getting everything to work with elevation maps (and not just B&W mazes) will also earn you extra credit.


GUI programming can be a potentially daunting experience. Below are some external resources to help get you going.


  • Usabaility
    • Your program exit cleanly in all cases: 2
    • It is clear how your program should be used: 2
    • There are no unwanted side effects (i.e. clobbered files): 2
  • Documentation
    • Your code contains ample comments: 4
    • Your program provides useful feedback to the user: 4
  • Code Design
    • Your code is modular: 4
    • Functions only do one thing: 2
    • Each function is no longer than 25 lines of code: 2
    • There were no code smells in your code (-2 for each): 10
    • You applied the MVC design pattern: 6
  • Functionality
    • GUI Can load a maze from a file: 2
    • GUI Contains a visualization of the maze: 2
    • Solve button solves the maze and visualizes the solution path: 4
    • GUI has inputs for any parameters including the costs and weights for A*: 4
    • GUI can run successive iterations over ranges supplied for heuristic: 4
    • GUI allows for basic editing of maze: 4
    • GUI can step through runs: 2
    • Extra credit: 5
  • Participation
    • You actively participated in discussion: 4
    • You came prepared based on your assigned code reading: 4
    • You handed your assignment in on time and to the correct location: 4
Total 72 Points
Document generated by Confluence on Feb 22, 2012 18:18

  1. No comments yet.

  1. No trackbacks yet.