User Tools

Site Tools


graphicsimagejkspirsq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

graphicsimagejkspirsq [2016/01/01 22:37]
graphicsimagejkspirsq [2016/01/01 22:37] (current)
Line 1: Line 1:
 +{{:​en:​kahn_joel_square_spiral.png?​200|}}
 +Square Spiral by Joel Kahn  (June 2010)
 +<​code>​
 +# Contributed by Joel Kahn
 +fastgraphics
 +cls
 +clg
 +graphsize 512, 512
 +r=1:g=1:b=1
 +x=250
 +y=250
 +s=1
 +plot x, y
 +for a=1 to 511
 +   ​x1=x+s*a
 +   ​y1=y+s*a
 +   q=s*1
 +   ​g=((abs(g+a))%255)+1
 +   for xx=x to x1 step q
 +      b=((abs(b+xx))%255)+1
 +      color r, g, b
 +      plot xx, y
 +   next xx
 +   for yy=y to y1 step q
 +      r=((abs(r+yy))%255)+1
 +      color r, g, b
 +      plot x1, yy
 +   next yy
 +   x=x1
 +   y=y1
 +   s=-s
 +   ​r=1:​g=1:​b=1
 +   ​refresh
 +next a
 +</​code>​
  
graphicsimagejkspirsq.txt ยท Last modified: 2016/01/01 22:37 (external edit)