Hey! I finally solved the Nugget problem. http://codepad.org/2Dlpegvr Originally, I was trying to group all the numbers of times a factor can go into X as a list. But that had problems, since I as merging lists. Constructive criticism? It runs fine for me, despite codepad saying there is an error.
Ugh. Make that problem 1. Will update with others in a minute... Or more...
there is some 'run code' option in codepad and it's always gives me an error, so turn it off.
It runs fine for me too. Codepad won't run anything with an input statement because it doesn't have a facility for runtime user interaction. I made a few changes that you can review. To keep it similar, I left i/j/k and a/b/c as-is, but you would want to have more descriptive variable names. For instance, you might use something as simple as num6, num9, and num12. So, 2 main changes. 1) I switched to straight value assignments for a/b/c instead of using tuples. It makes the code cleaner. 2) I initialized j/k/l to 0 at the start of the loop instead of at the end. That way you don't have to do multiple assignments in the outside loop, you eliminate four statements, and the code flow is more natural. http://codepad.org/m0xhrKcx
Just as a further refinement, you can use for loops instead of while loops. It keeps the loop variable, limit, and increment in one line. And there's not as much opportunity to get the loop control wrong (as your comment shows you've already experienced ;) ). The attached file shows the change. Also, I think your loops are going 1 higher than they need to.
Join our real-time social learning platform and learn together with your friends!