Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku Solver (Odin + Raylib 6)

A clean, interactive Sudoku editor and solver written in Odin using Raylib 6.

This project is both a useful tool and a learning platform for idiomatic Odin, modular design, and app structure.

Screenshots

Dark theme   Light theme   Exit dialog

Unsolvable puzzle   Solved board

Features

  • Full 9×9 grid with clear 3×3 block borders
  • Light & dark themes (toggle with Space)
  • Mouse + keyboard navigation (arrows, WASD, hjkl)
  • Tab / Shift+Tab jumps between 3×3 blocks
  • Number entry (19) and clear (Backspace / Delete)
  • Conflict highlighting (row, column, and 3×3 box) in red
  • Lock / unlock system (Ctrl+Shift+L toggles)
    • Locked cells use bold font + outline
    • Ctrl+Shift+C clears all unlocked cells
  • Backtracking solver (Alt+S); locked cells treated as givens
  • Save puzzles (Ctrl+S) to puzzles/easy/<hash>.sudoku (simple text format)
  • Load puzzles (Ctrl+O) — currently loads a fixed path; lists files in puzzles/easy
  • Exit confirmation dialog
  • Monospaced fonts (Roboto Mono)

Controls

Input Action
Mouse click Select cell
Arrows / WASD / hjkl Move selection
Tab / Shift+Tab Jump to next/previous 3×3 block
19 Enter number
Backspace / Delete Clear cell
Space Toggle light/dark theme
Ctrl+Shift+L Toggle lock on filled cells
Ctrl+Shift+C Clear all unlocked cells
Alt+S Solve current board
Ctrl+S Save puzzle
Ctrl+O Open puzzle (path still hard-coded)
Esc, then Y/N Quit

Building

make run      # odin run . -collection:src=src
make build    # produces ./sudoku-solver
make test     # runs logic tests

Requires a recent Odin with Raylib 6 and collection support (e.g. dev-2026-08+).

Project structure

.
├── main.odin              # entry: game.run()
├── Makefile
├── ols.json               # OLS collection: src
├── assets/
│   ├── fonts/...
│   └── screenshots/...
├── puzzles/easy/          # saved .sudoku files
└── src/
    ├── game/              # main loop
    ├── state/             # Game struct, constants, init
    ├── events/            # keyboard + mouse handlers
    ├── render/            # grid, numbers, dialogs
    ├── helpers/           # conflict check, which_block, etc.
    ├── logic/             # solver, save, load, list_puzzles
    ├── fonts/
    ├── theme/
    └── vecs/

Branches

  • master — stable snapshot of what works today
  • dev — active development (work only happens here)

Roadmap

  1. Selectable open path / simple file picker for load
  2. Dirty flag; warn on exit if unsaved
  3. Undo / Redo
  4. Pencil marks, more themes, export (stretch)
  5. WASM / Linux polish

Project roadmap also lives on the wiki DOC.

Notes

  • Coordinate convention: selected.x = row, selected.y = col
  • Locked cells = puzzle givens; Ctrl+Shift+C clears the rest
  • Prefer alphabetical order for struct fields and constant lists

License

Learning / personal use. Fonts are under the OFL (see assets/fonts/).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages