size 400 400 //設定背景 paper 100 fast //設計一個以中心點為座標的實心方形 command rects x y w h r g b { pen r g b repeat w1 0 50 { pen r g b line (x+(w1/2)) (y-h/2) (x+(w1/2)) (y+h/2)
line (x-w/2) (y-h/2) (x+w/2) (y-h/2) line (x+w/2) (y-h/2) (x+w/2) (y+h/2) line (x+w/2) (y+h/2) (x-w/2) (y+h/2) line (x-w/2) (y+h/2) (x-w/2) (y-h/2)
line (x-w/4) (y-h/4) (x+w/4) (y-h/4) line (x+w/4) (y-h/4) (x+w/4) (y+h/4) line (x+w/4) (y+h/4) (x-w/4) (y+h/4) line (x-w/4) (y+h/4) (x-w/4) (y-h/4)