For this first problem, we're going to be writing a program that checks Sudoku grids
to make sure that they are valid sub-grids, and if you haven't played Sudoku before we'll go over
briefly or you can go check the Wikipedia page,
which probably has a far more in-depth explanation than we could ever give here.
Sudoku is a game played by on a 9x9 grid, which will be representing as a list of lists
that contains 81 elements and each one of this 81 elements has to be a number between 0 and 9
including 0 and 9 and if either of this doesn't hold,
then we'll be returning none right away before we do anything else.
If we do pass those any checks, then we're going to return true if all of these hold,
which are the basic checks that go on in a Sudoku game.
Each number 1 through 9 occurs only once in each row.
It also occurs only once in each column and in each 3x3 sub-grid on the box on the board,
and it also occurs only once in each 3x3 sub-grid in the over all grid
and it might be clear with a bit of a picture.
Here you can see all nine 3x3 sub-grids.
Each of this should only have the number 1 through 9 once for each sub-grid.
Now, you can have zero in a valid sub-grid, it means it hasn't been encoded yet.
We don't have any solution, for instance, that has those numbers in it.
Your program would have to account for that, and I will give you a few examples before we expect.
First, we get an L form board where, see that this row doesn't have mine elements. It only has eight.
We should return none immediately.
This is a valid board with no zeros and it shouldt return true.
This is an invalid board that should return false, because it has the elements 1 through 9
either in more than once in a row or a column or a 3x3 sub-grid.
We need to check that is indeed the case for this one,
and then we have two that aren't finish.
One that's a fairly easy Sudoku puzzle appeared going solid by hand
and one that is actually quite difficult
to solve by hand at least for me and both of these should return true.
You can solve those piece with a valid different answers.
You're going to write this in the check_Sudoku function,
and give you these different statements to check them.
Now these are the only test cases we're going to be testing against for this problem set.
That's not really the point of this assignment though.
What I'd like you to do is go to the forums and post the code that
you used to solve this in the forums and we'll have a link to a specific forum post
in the instructor comments down below the video, so please check that.
I'd also like you to look at other people's code
and see if you can think of some fuzzers that would break these people's code.
Either a specific instances in those code or if you have a general purpose fuzzer
that would run well against general Sudoku checkers then go ahead and post that in the forums.
I'd really like you to think about what kind of inputs
and what kind of testing you would have to do in order to do this well.
I hope you had fun with this.
I hope there's a lot of great discussion on the forum about it,
and I look forward to seeing all of your solutions.
Okay, great. Have fun.