I developed this program as a culmination of all design patterns learned after completing a course in Systematic Program Design at UBC. That curriculum (CPSC 110) is based on How to Design Programs.
-
The earliest roots of the sudoku solving algorithm used in this code were from a backtracking search problem taught in class instructional materials. The original problem used a rudimentary brute-force search tree.
-
During class term, I accepted an extra challenge to redesign the same solver algorithm using constraint sets. Redesigning the data types and functions this way allowed the new algorithm to become much more efficient.
-
For this current project after term ended, I designed and built a full sudoku game with GUI that employs multiple variations on the constraint set algorithm. My game includes several features that make use of those constraint sets (e.g. autosolve mode, hint system, error tracking, and show choices).
My approach to this project used top-down systematic design and thorough test-driven development at every step. The code is entirely written in Racket's Intermediate Student, a pure functional language. It also uses the HtDW framework for interactive programs.
Smooth Sudoku's features and GUI are designed for a smooth and streamlined user experience. All input is through the mouse.
- In standard mode, hovering over any empty square in Write mode will reveal clickable options to fill.
- Switching to Erase mode in the top right allows to remove user-filled numbers with a click.
- Optional Show Errors feature automatically highlights incorrect number placements, softening game difficulty.
- Convenient Undo feature (with yellow highlight on mouse hover) allows quick backtracking on previous moves.
- Optional Show Choices feature provides another way to soften difficulty by showing and allowing only valid number placements.
- The Hint hover feature highlights one most recent error OR a square with fewest valid options. Clicking applies the hint.
- For a step-by-step speedthrough that removes all errors and adds missing values to a puzzle, click Auto-Solve.
- Players can reset a puzzle to its original state or start a new puzzle via. options in the bottom right.
- DrRacket 8.1+
- Language: Intermediate Student with lambda
HOW TO INSTALL: Install the latest version of DrRacket. Download and open the play-sudoku.rkt source file in DrRacket, then run the program using the DrRacket IDE.
- Windows 10+
HOW TO INSTALL: Download the latest .exe release from this repo folder, then run the application.
- On running the program, the game interface window will appear. Interact with it using the mouse to play.