0 Members and 1 Guest are viewing this topic.
:Prompt A,B,C:C²-B²-A²:√(Ans-2Ansnot(C
::"PYTHAGOREAN FINDER::0→dim(L1:100→dim(L1:ClrHome:Disp "ENTER LEG LENGTH"," ","DECIMALS ARE","ROUNDED:Input A:iPart(abs(A→A:If A>10^4:Then:ClrHome:Pause "THAT'S TOO LARGE:prgmPYTHAGRN:Return:End:1→C:1→B:If A=2iPart(A/2:2→C:ClrHome:Output(1,1,"FINDING FACTORS:Output(7,1,"AMOUNT FOUND:Output(5,1,"CHECKING NUMBER:While C≤A/2:Output(6,3,C:Output(7,14,B-1:Output(8,1,200C/A:Output(8,5,"PERCENT DONE:If A=CiPart(A/C:Then:C→L1(B:B+1→B:Output(3,1,"FOUND FACTOR:Output(4,3,C:End:C+2→C:End:ClrHome:1→B:1→J:While J:L1(B→J:B+1→B:End:ClrHome:B→L:3-L1(1→K:K+1→M:Output(2,1,"FINDING EXTRA:Output(3,1,"NUMBERS...:While K<B-1:If M≥B:Then:K+1→K:K→M:End:If B=1:Then:ClrHome:Pause "NO TRIPLETS!:ClrHome:Return:End:DelVar I:If M<B:∟L1(K)L1(M)→I:If I>L1(B-1) and I<A:Then:Output(4,1,"FOUND EXTRA:I→L1(L:L+1→L:End:If I≥A:Then:K+1→K:K→M:End:M+1→M:End:1→B:2→D:ClrHome:Output(1,1,"POSSIBLE TRIPLET":L1(B)→C:While C:If D=10 or D=9:Then:Pause:ClrHome:1→D:End:Output(D,1,"B=:Output(D,3,(A2-C2)/(2C:Output(D+1,1,"C=:Output(D+1,3,(A2+C2)/(2C:Output(D+2,1,"AREA=:Output(D+2,6,(A((A2-C2)/(2C)))/2:D+4→D:B+1→B:L1(B→C:End:Pause:ClrHome