The requirements for the Sudoku project are listed in the section below. Here are the requirements to achieve various TP grades:
| Grade | Requirements |
|---|---|
| 90 |
Nice user interface
Parts 1, 2, 3, and 4 working properly At least one moderately challenging extra feature (eg. undoing and redoing entire game states, or mouse/keyboard only modes) |
| 80 (MVP) |
Usable user interface
Parts 1, 2, and 3 working properly |
| 70 |
Usable user interface
Parts 1 and 3 working properly Part 2 UI indication of incorrect value (from solution board files, not backtracking) |
| 60 |
Usable user interface
Part 1 mostly working (either automatic or manual legals do not need to be completed) |
Note that these are not the only ways to achieve the listed grades, but they should give you an idea of the requirements needed to hit different grade thresholds. If you want to swap out one of the features listed above with a different one of comparable difficulty, discuss it with your mentor! It will most likely be allowed (and encouraged). Make this project your own!
itertools.combinations() to loop over all the
possible combinations of N values from a list of values. For
example:
import itertools
L = [ 'cat', 'cow', 'dog', 'gnu', 'pig']
print('Here are all the animals:')
print(' ', L)
print('Here are all the combinations of 3 animals:')
for M in itertools.combinations(L, 3):
print(' ', M)
Running that code produces this output:
Here are all the animals:
['cat', 'cow', 'dog', 'gnu', 'pig']
Here are all the combinations of 3 animals:
('cat', 'cow', 'dog')
('cat', 'cow', 'gnu')
('cat', 'cow', 'pig')
('cat', 'dog', 'gnu')
('cat', 'dog', 'pig')
('cat', 'gnu', 'pig')
('cow', 'dog', 'gnu')
('cow', 'dog', 'pig')
('cow', 'gnu', 'pig')
('dog', 'gnu', 'pig')
We hope everyone includes some clever and engaging extra features. The points you receive for these features will depend on two things: (1) how much they improve gameplay, and (2) how sophisticated the code is. Below are some ideas for you, but you are encouraged to get really creative.
Note: this list is not in any particular order, and certainly leaves off many other wonderful ideas!
This gives you the opportunity to modestly consider accessibility issues. Design game modes that only require keyboard input or mouse input. Try to make the user experience as streamlined as possible!
In medium-or-harder play, the the user can press a key and the app will automatically select the next singleton (cell with only one legal value) and make that move (entering that sole legal value into that board cell). It will repeat this process until there are no singletons left.
Users can undo moves, all the way back to the starting board, and then they can redo undone moves. After an undo, if the user makes a new move, then the list of moves to redo is cleared.
An especially engaging, powerful, easy-to-use, beautiful user interface.
Implement one or more of the variations listed here or here or here (or many other websites). Some of these are very challenging, others are simply beautiful.
A preferences file that is loaded with colors (for empty cells, initial board values, the current selection, etc) and other preferences (show/hide legals, etc), and is saved each time the user changes these preferences.
Improve the backtracker to solve boards (especially harder boards) as fast as possible.
Generate hints that solve hard, expert, or evil boards.
Given a Sudoku board, use some random sequence of legal-board-preserving transformations like those mentioned here (and many other websites) to transform the board into an equivalent but very different looking board. This gives the user what seems like an infinite number of boards at the same level of difficulty to play based on a small set of starter boards.
Write an algorithm to randomly generate Sudoku boards. Be sure to be level-appropriate. Medium boards, for example, must be solvable using only the first two hints.
An ambitious feature is to use selenium to control the web browser, so your Python app can access the board while you are using sudoku.com in Chrome. Then, you can use PIL (pillow) to do OCR (optical character recognition), so that you can detect the values on the board in the browser. Then, you can use your hint generator to display hints, or even to automically solve the board (again, directly in Chrome). This is very cool if also ambitious.
Again, this list is very incomplete. Dream up your own wonderful ways to enhance gameplay or the user experience.