Sudoku - A popular puzzle game that has also gained interest among programmers due to its logical nature.

Today, we learn how to use a recursive method to solve a puzzle with brute force. While no guessing is actually required to solve a Sudoku puzzle, the method we see here takes an elegant approach to guessing, deriving solutions in a very short amount of time.


= Links and Downloads =
WinSudoku - https://sourceforge.net/projects/winsudoku/
Full sudoku client that also lets you generate puzzles

Download the code here - https://drive.google.com/drive/folders/0B2Ia5aQpQ8CndnRReS1xUy04QW8?resourcekey=0-DusvA26CCA_9cEhuJviNOA&usp=sharing


= Contents =
0:47 Rules of Sudoku
2:06 Part 1 - Architecture
-→ 2:29 Solving Strategies
-→ 3:16 Psuedocode (explaination focusing on the recursion)

6:42 Part 2 - Programming the Basics
-→ 7:21 Converting the board to mutable lists
-→ 9:07 Building the solve() function which checks every cell
-→ 10:33 Function for getting the possible values in a cell
---→ 11:48 Brief digression to look at Python comprehensions and sets
---→ 14:54 Return to writing getPossibilities()
---→ 17:10 Discussion on how to extract 3x3 squares
---→ 20:51 Testing the getPossibilities() function
-→ 22:06 Making the solve() function loop and solve as much as it can
-→ 23:22 I fix some bugs and provide a new board
-→ 24:00 Writing a printBoard() function

25:50 Part 3 - Getting started with the recursive solution
-→ 26:36 Writing isComplete() to check if the game is complete
-→ 27:56 Finding a cell to guess with
-→ 28:56 Starting to write the recursive step
-→ 29:38 Rolling back bad guesses with copy.deepcopy()
-→ 30:50 Detecting contradictions
-→ 32:46 We're done! Now testing

34:15 Conclusion



= 0612 TV =
0612 TV, a sub-project of NERDfirst.net, is an educational YouTube channel. Started in 2008, we have now covered a wide range of topics, from areas such as Programming, Algorithms and Computing Theories, Computer Graphics, Photography, and Specialized Guides for using software such as FFMPEG, Deshaker, GIMP and more!

Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!

Like what you see? Buy me a coffee → http://www.nerdfirst.net/donate/

0612 TV Official Writeup: http://nerdfirst.net/0612tv
More about me: http://about.me/lcc0612
Official Twitter: http://twitter.com/0612tv

= NERDfirst =
NERDfirst is a project allowing me to go above and beyond YouTube videos into areas like app and game development. It will also contain the official 0612 TV blog and other resources.

Watch this space, and keep your eyes peeled on this channel for more updates! http://nerdfirst.net/

-----

Disclaimer: Please note that any information is provided on this channel in good faith, but I cannot guarantee 100% accuracy / correctness on all content. Contributors to this channel are not to be held responsible for any possible outcomes from your use of the information.