Jonqora / racket-sudoku

Feature-rich sudoku application coded entirely in a Lisp-based, pure-functional language (Racket ISL).

Home Page:https://ellenlloyd.ca/racket-sudoku/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smooth Sudoku

About

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.

  1. 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.

  2. 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.

  3. 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.

Features

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.

Smooth Sudoku: new game and hover-to-play

  • 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.

Smooth Sudoku: show errors and undo

  • 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.

Smooth Sudoku: hints and show choices

  • 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.

Smooth Sudoku: autosolve and win screen

User Information

COMPATIBILITY

To run from source code:

  • 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.

To run .exe release file:

  • Windows 10+

HOW TO INSTALL: Download the latest .exe release from this repo folder, then run the application.

USING THE PROGRAM

  • On running the program, the game interface window will appear. Interact with it using the mouse to play.

About

Feature-rich sudoku application coded entirely in a Lisp-based, pure-functional language (Racket ISL).

https://ellenlloyd.ca/racket-sudoku/

License:Other


Languages

Language:Racket 99.4%Language:HTML 0.6%