jag426/euler

96 comments

dtwitty opened this issue · 2 comments

  1. All functions should have a comment or docstring explaining their purpose, arg and return types, etc
  2. It is bad practice to both modify and then return an input arg.
  3. Cool guys use xrange (an iterator with O(1) memory) instead of range (a list with O(n) memory)
  4. 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.
  5. How would you test each function?
  1. Python 3
  2. 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?
  1. fixed enough
  2. see previous comment
  3. see previous comment
  4. clarified in documentation
  5. tests will be added eventually; feel free to open a new issue