This is a set of small programs in Basic-256, related to various topics.
Just copy,paste and run.
Note : Sometimes programs do not run in recent BASIC 256 versions.
Wednesday, October 6, 2010
Pythagorian triple distribution
t=-1
clg
for c=3 to 3000
for b=2 to c-1
asquared=c^2-b^2
a=(asquared)^.5
if a=int(a)then
t=t*(-1)
if t=-1 then print a+chr(178)+"+"+b+chr(178)+"="+c+chr(178)
if a<3000 and b<3000 then plot a/10,b/10
end if
next b
No comments:
Post a Comment