# Version without functions (for BASIC-256 ver. 0.9.6.66) graphsize 390,270 level = 18 : insize = 247 # initial values x = 92 : y = 94 # iters = 2^level # total number of iterations qiter = 510/iters # constant for computing colors SQ = sqrt(2) : QPI = pi/4 # constants rotation = 0 : iter = 0 : rq = 1.0 # state variables dim rqs(level) # stack for rq (rotation coefficient) color white fastgraphics rect 0,0,graphwidth,graphheight refresh gosub dragon refresh imgsave "Dragon_curve_BASIC-256.png", "PNG" end dragon: if level<=0 then yn = sin(rotation)*insize + y xn = cos(rotation)*insize + x if iter*2