COMP 304B Object-Oriented Software Design -- Assignment 4

COMP 304B Object-Oriented Software Design - Assignment 4
  Due date: Monday 30 March before 23:55

 

Update (28 March 2009)

The starting point Sudoku.zip has been updated and replaced with Sudoku.startingPoint.zip. The changes are: Note that Undo of both entering values and of loading a Sudoku configuration needs to be supported!

Practical information

The assignment

In this assignment, you will implement part of the functionality of Ultimate Sudoku, a Sudoku game, by means of the Command Pattern and the Visitor Pattern.

When the application starts, you are presented with a control panel. The control panel allows you to open up specific views of the Sudoku board. These views allow a player to focus on a particular area of the board. The offset of a particular view from the top-left corner of the full board is shown as the window name.

Players can enter values (1 - 9) in cells, on any view. They do this by first clicking on a cell, which selects it (and turns the background grey). When a new value is entered, all the appropriate views need to be updated. This means data is stored in a central location to which views are attached. The beginning of a central SudokuBoardState is provided to store this central data. In the next assignment, you will use the Observer Pattern to support multiple, consistent views. In this assignment, you will only care about the Full Board.

As shown above, the code you are given as a starting point provides basic display functionality. To clarify the (row, column) coordinates used, it displays coordinates in cells. Note that these coordinates are "local" to the view. One needs to add the offset of the view to these coordinates to obtain the corresponding central coordinates. The displayed coordinates are just for clarification and should not be shown in your solution. Your solution should start with blank cells.

Requirements

  1. support "undo". Note that Undo of both entering values and of loading a Sudoku configuration needs to be supported!
  2. support "persistence" (save/load, in a format of your choice). Note that you will have to add to the UI for this.

Design

You should provide two UML diagrams:

  1. A Class Diagram of your solution. This diagram should include all components of your solution, including your GUI classes. Of course, you don't need to draw classes from libraries, such a Tkinter.
  2. A Sequence Diagram of what happens for both requirements.

Implementation

Your Sudoku game must be designed in boUML and implemented in Python by means of code synthesis from your design using boUML. The starting point (code) for this assignment is found in Sudoku.startingPoint.zip.


Hans Vangheluwe & Alexandre Denault, March 2009