I wrote a program for class. It did its job, but I want to make it better. The program finds all of the Pythagorean triples between 1 and 100.
As you can see, the program will repeat the same Pythagorean triples but in different orders.
What I want to do is have the program repeat each Pythagorean triple once, regardless of whether the ordering is different. I have tried, but only came up with the solution to solving repetition that is consecutive. But the repetition for Pythagorean triples jump around.
I got stuck on how to eliminate jumping repetitions. I only know how to make it not repeat on consecutive entries.
Can anyone give some advice? I think this knowledge might be helpful for future codes.
EDIT: Deleted code and some other stuff because problem solved.
That works. I confused myself and thought it didn't work when changing the initial values because it didn't output (12, 5, 13). Then I realized that (12, 5, 13) is output as (5, 12, 13) already. I confused myself there. Thanks.