2009年11月12日 星期四

patten-馬路如虎口



利用簡單的矩形跟線條
排列出斑馬線跟路燈的意象


size 400 400
paper 100



repeat a 0 75

{

pen 0
line 10 a 20 a

line 30 (210-a) 40 (210-a)

line 50 (350-a) 60 (350-a)

line 70 (400-a) 80 (400-a)

}

repeat b 0 100
{
line 100 (250-b) 110 (250-b)

line 130 (300-b) 140 (300-b)

line 160 (350-b) 170 (350-b)

line 190 (400-b) 200 (400-b)
}

repeat c 0 40
{
line 250 (25+c) 260 (25+c)

line 280 (80+c) 290 (80+c)

line 310 (125+c) 320 (125+c)

line 340 (200+c) 350 (200+c)

line 370 (250+c) 380 (250+c)

}

repeat d 0 10
{
line d 25 d 35
line d 50 d 60
line d 75 d 85
line d 100 d 110
line (10+d) 110 (10+d) 120
line (30+d) 110 (30+d) 120
line (30+d) 225 (30+d) 235
line (30+d) 255 (30+d) 265
line (50+d) 255 (50+d) 265
line (50+d) 360 (50+d) 370
line (50+d) 390 (50+d) 400
line (70+d) 310 (70+d) 300
line (70+d) 280 (70+d) 270
line (70+d) 250 (70+d) 240
line (70+d) 220 (70+d) 210
line (70+d) 190 (70+d) 180
line (70+d) 160 (70+d) 150
line (70+d) 130 (70+d) 120
line (100+d) 130 (100+d) 120
line (130+d) 130 (130+d) 120
line (160+d) 130 (160+d) 120
line (220+d) 130 (220+d) 120
line (250+d) 130 (250+d) 120


line (190+d) 280 (190+d) 270
line (190+d) 250 (190+d) 240
line (190+d) 220 (190+d) 210
line (190+d) 190 (190+d) 180
line (190+d) 160 (190+d) 150
line (190+d) 130 (190+d) 120
line (190+d) 100 (190+d) 90
line (190+d) 70 (190+d) 60
line (190+d) 40 (190+d) 30
line (190+d) 10 (190+d) 0


line (40+d) 75 (40+d) 85

line (30+d) 50 (30+d) 60

}


repeat e 0 20
{
line (260+e) 200 (270+e) 190
line (300+e) 280 (290+e) 290
line (320+e) 375 (330+e) 365

}

line 290 120 290 190
line 320 165 320 280
line 350 240 350 365

repeat f 0 10
{
line (220+f) 10 (220+f) 0
line (250+f) 10 (250+f) 0
line (280+f) 10 (280+f) 0
line (310+f) 10 (310+f) 0
line (340+f) 10 (340+f) 0
line (370+f) 10 (370+f) 0
line (390+f) 10 (390+f) 0

}


2009年11月5日 星期四

期中測驗



size 550 400
paper 0
field 15 375 60 380 100
fast
load dbngraphics.dbn
circle 125 225 80 100
triangle 125 225 50 330 200 330
triangle 125 225 75 25 175 25

set M 35
Repeat A 0 50
{
pen 100
triangle 250 225 225 170 275 170
triangle 250 170 230 120 270 120
triangle 250 120 235 55 265 55

}

//直角三角形
triangle 400 380 280 160 400 160

//等腰倒三角
triangle 420 80 325 150 500 150

//2三角為正方
triangle 400 275 470 275 470 240
triangle 400 275 400 240 470 240

//長方形
field 401 230 490 220 100

//右邊兩直角
triangle 400 210 400 180 450 210
triangle 400 180 400 160 430 180

//等腰上的正三角
triangle 480 150 450 180 510 180