2009年10月28日 星期三

作業四-command square-大樓









size 250 250
paper 90
command square x y s c
{
pen x 50 45
line x y x (y+s)
line x (y+s) (x+s) (y+s)
line (x+s) (y+s) (x+s) y
line (x+s) y x y}fast

//四外圍repeat A 0 250
{
pen 50
line 0 A 20 A
}
repeat A 250 0
{
pen 50
line 250 A 230 A
}
repeat A 0 250
{pen 70
line A 230 A 250
}
repeat A 250 0
{pen 70
line A 20 A 0
}

//正方
repeat D 13 25
{
repeat A 0 7
{
repeat B 0 5
{
square (6+(A+A)*15) (12+(B+B)*20) D ((A+B)*8)
}
}
}
//協正芳
repeat A 37 0
{
repeat B 0 0{square (20+A*5) (20+A*5) 25 (A+B)
}
}
repeat A 16 0{repeat B 0 0{square (125+A*5) (20+A*5) 25 (A-B)
}
}
repeat A 17 0{repeat B 0 0{square (20+A*5) (120+A*5) 25 (A+B)
}
}


沒有留言:

張貼留言