size 400 400 set mapsize 400 paper 10 20 30 number mod x y { value (x-(y*(x/y))) }
set rseed number random x { set r1 (rseed*435437) set r2 (rseed+945878) set rseed value } command mirror x y { set color set [x y] color set temp (mapsize-x) set [temp y] color set temp (mapsize-y) set [x temp] color set temp (mapsize-x) set tempx (mapsize-y) set [temp tempx] color } set startx 0 set starty 0 forever { same? 100 { mirror } }
paper 10 50 60 number mod x y { value (x-(y*(x/y))) }
set rseed number random x { set r1 (rseed*435437) set r2 (rseed+945878) set rseed value } command circlepixels cx cy dx dy v { set [(cx+dx) (cy+dy)] v set [(cx+dx) (cy-dy)] v set [(cx-dx) (cy+dy)] v set [(cx-dx) (cy-dy)] v set [(cx+dy) (cy+dx)] v set [(cx+dy) (cy-dx)] v set [(cx-dy) (cy+dx)] v set [(cx-dy) (cy-dx)] v }
command circle cx cy radius v { set x 0 set y radius set d (1-radius) circlepixels cx cy x y v // 707/1000 approximates square root of 0.5 = cos(45) repeat x 0 (radius*707/1000) { set tempd d smaller? tempd 0 { set d (d+(2*x)+3) } notsmaller? tempd 0 { set d (d+(2*(x-y))+5) set y (y-1) } circlepixels cx cy x y v } } set startx 0 set starty 0 forever {
set startx set starty set repeattime repeat b 0 repeattime { set a circle startx starty a (startx+starty) set [] 0 } }
command rect x y w h c { pen 100 line (x-w/x) (y-h/x) (x+w/x) (y-h/x) line (x+w/w) (y-h/w) (x+w/w) (y+h/w) line (x+w/y) (y+h/y) (x-w/y) (y+h/y) line (x-w/h) (y+h/h) (x-w/h) (y-h/h) } forever { rect 50 20 }
command rect x y w h c { pen 100 line (x-w/x) (y-h/x) (x+w/x) (y-h/x) line (x+w/w) (y-h/w) (x+w/w) (y+h/w) line (x+w/y) (y+h/y) (x-w/y) (y+h/y) line (x-w/h) (y+h/h) (x-w/h) (y-h/h) } forever { rect 50 20 }