Functional Sudoku Solver
summary
Builds a Sudoku solver in Scala that models a 9x9 grid as a Vector[Vector[Cell]], uses immutable Vector with zipWithIndex, grouped and transpose to extract rows columns and 3x3 squares, and represents cells as either Fixed(value) or Undetermined(candidates). Implements row/column/square checks and a filter step that removes impossible candidates and promotes size-1 cells to fixed ones. Claims it solves many puzzles (tested on 100 simple examples) but no backtracking, so it fails on hardest grids.
AI-written summary · about
chapters (12)
- 0:00Introduction to talk
- 0:47Sudoku rules explained
- 1:08Case classes in Scala
- 2:31Vector library overview
- 4:18Grouping operator for Sudoku
- 5:42Tuples and zip with index
- 6:24Transpose operator explained
- 6:45Data modeling for Sudoku
- 8:09Row and column validation
- 8:50Square validation logic
- 9:53Filtering Sudoku grid
- 12:21Q&A on solvability
