Saturday, June 25, 2011

PE9 WIP

Every time I take another look at PE 9 I confuse myself. Woof.

I did PE 8 in XCode and it really helped to have the debugger telling me what all my variables are as the loop progressed. Every problem I was having I diagnosed through that. That's an extremely superficial use of the debugger from what I can tell.

EDIT: Thought of a first step. Remember that a < b < c, so the largest that c can be is 997 (in the instance of a = 1 and b = 2). Obviously that's not a real life situation, but what other constraints are there? b can only be 499 at the most when a = 1, b = 499, and c = 500. Again, not ever actually going to happen but it's a good place as any to make my loop end.

What's an instance where a ^ 2 + b ^ 2 = c ^ 2 such that c isn't a natural number?

2 ^ 2 + 5 ^ 2 = 29. Ok, how do I know that the square root of 29 isn't a natural number? I need to find a way to test for square-rootness. I'm sure there's a good way to do it that's just not jumping out at me.

No comments:

Post a Comment