How uncodem/sudoku works
This repository is a Sudoku progressive web app for playing puzzles online or offline. A player starts a generated or bank puzzle, enters numbers and notes through keyboard or keypad controls, and can scan, solve, pause, or resume; the app saves progress and elapsed time for restoration. Puzzle generation and solving run in a Web Worker, while the browser UI, game state, rendering, and timer form the interactive runtime. The README documents offline play and VIM-style bindings; the service-worker implementation and puzzle-bank loading details were not excerpted.
Main entry points: main.ts App Controller · render.ts Board Renderer · vim.ts Keyboard Controls · worker.ts Worker Dispatcher
Components 17
Gameplay
- Game Interface
public/index.html - App Controller
src/main.ts - Game State
src/game.ts - Keyboard Controls
src/vim.ts - Board Renderer
src/render.ts - Game Timer
src/timer.ts - Cell Types
src/types.ts
Puzzle Engine
- Puzzle Bank
src/puzzlebank.ts - Worker Dispatcher
src/worker.ts - Puzzle Generator
src/generator.ts - Puzzle Solver
src/solver.ts - Board Model
src/board.ts
Browser Runtime
- Session Persistence
src/persist.ts - Browser Storage
Offline Content
- Service Worker
public/sw.js - Puzzle Data
public
Other components
- Player
Connections 25
- Player → Game Interface: plays through
README.md - App Controller → Game Interface: binds controls
src/main.ts - App Controller → Game State: updates and reads
src/main.ts - App Controller → Board Renderer: builds and renders
src/main.ts - App Controller → Keyboard Controls: registers input
src/main.ts - App Controller → Game Timer: controls timer
src/main.ts - App Controller → Puzzle Bank: requests puzzles
src/main.ts - App Controller → Session Persistence: loads and saves
src/main.ts - Keyboard Controls → Game State: edits cells
src/vim.ts - Keyboard Controls → Board Renderer: moves and renders
src/vim.ts - Keyboard Controls → Game Timer: toggles pause
src/vim.ts - Board Renderer → Game State: reads board state
src/render.ts - Game Timer → Board Renderer: hides board
src/timer.ts - Board Renderer → Cell Types: uses cell types
src/render.ts - Game State → Cell Types: uses cell types
src/game.ts - Session Persistence → Browser Storage: reads and writes
src/persist.ts - App Controller → Worker Dispatcher: sends commands
src/main.ts - Worker Dispatcher → Puzzle Generator: generates puzzle
src/worker.ts - Worker Dispatcher → Puzzle Solver: searches solution
src/worker.ts - Worker Dispatcher → Board Model: parses board
src/worker.ts - Puzzle Generator → Board Model: builds candidate boards
src/generator.ts - Puzzle Generator → Puzzle Solver: uses solving strategies
src/generator.ts - Puzzle Solver → Board Model: checks candidates
src/solver.ts - Service Worker → Puzzle Data: serves offline content
- Player → Service Worker: uses offline app
README.md