I'm starting to ask questions in the Euler project, and I would like to approach it with a TDD style, but it's hard for me to find a numerical answer to a question that does not include code. Is there any resource with this data so that I can make test cases that will tell me if I solved the problem correctly?
My motivation for this is that I feel that the algorithm is the answer, not the number. If I look at the sample code of another user, this will destroy the problem in order to figure out how to solve the problem.
Edit: I'm looking for a specific answer number with no context or algorithm so that I can do something like the following. I know this is more detailed, but I would like to get a result with an error / message about whether my algorithm works correctly, and not look at an example of another code to find out if I did it correctly.
import unittest
class ProblemOneTest(unittest.TestCase):
def test_me(self):
self.assertEquals(solve_problem_one(),233168)
if __name__ == '__main__':
print "Problem 1 possible answer: %d" % solve_problem_one()
sys.exit(unittest.main())
source
share