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

COMP 304B Object-Oriented Software Design - Assignment 6
  Due date: Wednesday April 11th, 2007 before 23:55

 

Practical information

The assignment

In this assignment, you will implement Ultimate Sudoku, a Sudoku game that uses the Observer Pattern. You'll find that many of the other design patterns (such as Command) will make the implementation much easier and most elegant.

Ultimate Sudoku functions as follows: When a game starts, you are presented with a 9x9 Sudoku board and a control panel. The control panel allows you to open up new specific views of the Sudoku board. These views allow a player to focus on a particular area of the board. Players can enter their solution using the main Sudoku board, or any of the sub views. When a new value is entered, all the appropriate views are updated. This means data is stored in a central location to which views are attached. Note that when the board is updated, only the affected views should be updated.

Ultimate Sudoku also features two undo functionalities. The first, "undo last move", allows a player to undo his last move. Pressing the button again further reverse the board by undoing the move before. This functionality is very useful given that players might be solving the board using multiple windows. The second, "undo since error", will allow a player to undo moves if he has committed an error. For example, a player erroneously enters the value 4 in the square 3,3. He then continues to do 10 other moves until he discovers that he made a mistake. By pressing the "undo since error" button, the game will roll back to the state it was before entering the value 4 in 3,3. This will be achieved by undoing the 11 last moves.

Your implementation of Ultimate Sudoku should contain at least 1 Sudoku puzzle. To properly support the undo functions and the end game, you will also need to know the solution to the puzzle. Your first implementation can simply load these information from a text file. However, you might to further improve this system.

When a player successfully solves a Sudoku board, the game should inform the player and allow him to play again.

UML

Before implementing your solution, I want you to draw 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 when a player enters a new value in the main grid. This should include the updating of your data structure and the notification of the views.

Implementation

Your Sudoku game must be implemented in Python. A simple GUI for this assignment is available here.

Handin

You should hand in the following:

Grading

Correctly implementing the following minimal features will allow to obtain of approximately 70% :

Correctly implementing the following additional features will allow you to obtain a maximum grade of 85%.

To have a grade of a 100%, you must correctly implement all of the previous features, plus a couple from the following list.

Note: One of your Sudoku puzzles should be easy enough, so the grader can complete it and test the win condition (cheat mode?).


Alexandre Denault, March 2007