Due date: Tuesday 14 April before 23:55
You may submit until Friday 17 April 23:55 without penalty.
Note however that you will then not receive your grades and comments for the assignment before the final exam!
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 continue the design and implementation of a Sudoku game.
In particular, you will add the Observer Pattern (pull approach).
You will also re-factor your previous design, if appropriate. You may introduce
patterns of your choice.
Requirements
The application will support all the functionality of Assignment 4 (i.e., undo, load/save, etc.).
The application will properly allow entering and displaying numbers in any view.
The application will include the generation of (random) Sudoku game boards.
You will need to add a button for this.
An optional sophistication is to allow the user to specify a "hardness level".
When a user starts solving the board, there are two types of errors which need to be handled:
"trivial" error: the number entered violates the basic rules (each number
occurs exactly once in each row, column, and 3x3 block). The user must be told
about this error and this entered number should not be committed.
"deep" error: the number entered does not violate the basic rules, but
it will not lead to a solution. Only if the user has chosen to have
warnings shown will this be made known to the user.
The mysterious "undo until last error" from Assignment 4 refers to rolling back to the last state
from which a solution can be obtained.
To implement the Sodoku board generation and checking, you may use any source
(as long as you mention it). An excellent starting point is
David Bau's Sudoku generator.
Design
You should provide several 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.
As the overall Class Diagram will be quite large, it is suggested that you
provide multiple "views", focusing on different parts of the design (in particular, on the Observer Pattern).
A Sequence Diagram illustrating a concrete instance of the Observer Pattern at work.
The entities in your diagram must obviously be instances of classes in your Class Diagrams.
Implementation and Testing
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 your solution to Assignment 4
which in turn was based on Sudoku.startingPoint.zip.
You must provide a test suite for your Sudoku game. This test suite should include tests
for the Command Pattern (from Assignment 4) and the Observer Pattern parts of your design.
Update: you only need to include a test for one of these patterns. Note
also that for the tests, you can turn off the UI and go directly to the underlying non-UI API.
As there should be a test for every single requirement, you should explicitly provide
a list of requirements, and a unit test for each. You should use the PyUnit testing framework.
It is suggested you use a directory structure similar to that for Assignment 1
(see prototype3.spreadsheetCells.tgz).