c A small "fun" test program for the VT125: fractals! Program FRACTALS cx=140 cy=96 x=.50001 y=0 type *,'What is lambda?(x,y)' accept *,lx,ly call fol(s,lx,ly) type *,'what is scale' accept *,sc call init call scale(-300.,300.,-300.,300.) sc=2*cx/sc do 10 i=1,10 call funxy(x,y,lx,ly) 10 continue 20 call pl(sc,x,y,cx,cy) call funxy(x,y,lx,ly) goto 20 stop end subroutine pl(sc,x,y,cx,cy) xt=sc*(x-.5)+cx yt=cy-sc*y call draw(xt,yt) return end subroutine qrt(x,y,s) t=y s=sqrt(x*x+y*y) y=sqrt((-x+s)/2) x=sqrt((x+s)/2) if(t.lt.0)x=-x return end subroutine fol(s,lx,ly) s=lx*lx+ly*ly lx=4*lx/s ly=-4*ly/s return end subroutine tl(x,y,lx,ly) tx=x ty=y x=tx*lx-ty*ly y=tx*ly+ty*lx return end subroutine funxy(x,y,lx,ly) call tl(x,y,lx,ly) x=1-x call qrt(x,y,s) rr=ran(int(x)) if(rr.ge.0.5)goto 30 x=-x y=-y 30 x=1-x x=x/2 y=y/2 return end