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:
fixed the key codes in clearkey;
added buttons for Load/SaveAs/Save/Undo to the UI;
added tkFileDialog for load/save filename selection.
Note that Undo of both entering values and of loading a Sudoku configuration needs to be supported!
Practical information
Due date: Monday 30 March before 23:55
Team size == 2
Your submission must be in the form of a simple HTML file (index.html) with explicit references to all submitted
files as well as inline inclusion of images. See the general assignments page for an index.html template.
Each team submits only one full solution. The other team member must
submit a single index.html file containing only the coordinates of both team members. This will allow us to put
in grades for both team members in WebCT.
To get insight into the assignment workload, provide the number of hours you spent on this assignment.
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
support "undo". Note that Undo of both entering values and of loading a Sudoku configuration needs to be supported!
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:
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.
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.