This shows you the differences between two versions of the page.
graphicsimagejkspirsq [2016/01/01 22:37] |
graphicsimagejkspirsq [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{: | ||
+ | Square Spiral by Joel Kahn (June 2010) | ||
+ | < | ||
+ | # 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 | ||
+ | | ||
+ | | ||
+ | q=s*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 | ||
+ | | ||
+ | | ||
+ | next a | ||
+ | </ | ||