## ← Sudoku Solver - Software Testing

• 2 Followers
• 36 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=huxKIDWM0UY" data-team="udacity"></div> ``` 1 Language

Showing Revision 3 created 05/25/2016 by Udacity Robot.

1. The challenged problem for this problem set
2. is essentially an extension of what's already done in the first problem.
3. Instead of checking whether a Sudoku board is valid, we're actually going to be solving
4. the Sudoku board and coming up with a valid solution assuming that it is valid.
5. So, we're going to be extending new check Sudoku function.
6. Since I don't know what you wrote, then I invite you to paste this in
7. or paste it into something else, run it locally, and then give your findings on the forum
8. and the code for people to handle has end and hopefully break.
9. Now, our Sudoku solver is going to be essentially an extension,
10. so it should return None for broken input just like check_Sudoku does.
11. False for inputs with no valid solutions and a valid 9/9 Sudoku grid
12. containing no zero elements at the end.
13. Any 0 elements that are in board that's pass N assuming it's valid
14. should be solved and changed into numbers one through nine that give a valid solution.
15. There are a lot of ways you can do that.
16. There are a lot of clever ways to solve a partially completed Sudoku board.
17. We could always just go with brute-force recursive solution
18. may be not the best idea if people end up testing against very, very difficult puzzles,
19. and you can come up with some really pathologically evil Sudoku puzzles
20. if you don't have fast algorithm.
21. The one I'll be showing you in the solution video is essentially just a brute-force algorithm.
22. Please give some example of some Sudoku puzzles
23. that maybe it wouldn't fair so well against or maybe it would take a very, very long time to complete.
24. We're going to be running this in the equator against the same Sudoku puzzles.
25. Hardest commented out by default because for a more naive Sudoku solver,
26. it will take a little bit of time maybe five to 10 seconds or so
27. depending on exactly how you plotted it out to actually solve this one
28. and there are going to be multiple different solutions depending on exactly how you code this up.
29. We are going to be checking that.
30. We would simply be checking that it's a valid Sudoku board with no zeros.
31. And again, I invite you to post your solution code in the forums,
32. how you coded it out, what you think it might be vulnerable to,
33. and to break other people's code and see how you would test against a Sudoku solver,
34. which is a bit more complicated of a piece of code than the checker itself.
35. There are a few more ways that things can go wrong.
36. Okay, I hope you had fun with this, and I hope you enjoy breaking everyone else's code.