Skip to content

This is a student project Sudoku solver, which uses a CSV file containing a million puzzles sourced from: https://www.kaggle.com/bryanpark/sudoku

Notifications You must be signed in to change notification settings

calebrcannon/sudoku-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

sudoku-solver

This is a student project Sudoku solver, which uses a CSV file containing a million puzzles sourced from: https://www.kaggle.com/bryanpark/sudoku

The puzzles in the CSV were generated using: https://www.ocf.berkeley.edu/~arel/sudoku/main.html

In order to use this code, you will need to download the CSV mentioned above. You'll also need to change the file path of the code to reflect where you saved the CSV, I've added a comment to indicate where: Screenshot 2021-05-03 131946

The code reads through the puzzle, and attempts to find places where there is only one possible number to enter into an empty space. If the puzzle hasn't been changed since looking through the puzzle for a space with only one possible answer, the code will move on to searching for naked pairs. Naked pairs are two sets of empty spaces in a row, column, or subgrid that have only two identical possible numbers. Once a naked pair is found, those two possbile numbers are removed from the rest of the row, column, or subgrid.

Note that the program does not print out the solved puzzles, only the number of puzzles solved, unless the program is unable to solve the puzzle, in which case it will print it out unsolved.

About

This is a student project Sudoku solver, which uses a CSV file containing a million puzzles sourced from: https://www.kaggle.com/bryanpark/sudoku

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages