96 comments
dtwitty opened this issue · 2 comments
dtwitty commented
- All functions should have a comment or docstring explaining their purpose, arg and return types, etc
- It is bad practice to both modify and then return an input arg.
- Cool guys use xrange (an iterator with O(1) memory) instead of range (a list with O(n) memory)
- Suggest method "TrytoSolve" which takes in a board (with contract that board can be modified except for existing cells) and trys to solve the board. Return true if the modified board is now solved, false if the (possibly garbage) board cannot be solved. Even better if you guarantee than an unsolved board will be returned to it's original state.
- How would you test each function?
jag426 commented
- Python 3
- I am fairly sure the solve function currently does this. As noted in 1), this would be more obvious if it were stated in a comment; will fix. How do you reconcile this advice with 2), though?
jag426 commented
- fixed enough
- see previous comment
- see previous comment
- clarified in documentation
- tests will be added eventually; feel free to open a new issue