2009年11月13日 星期五

Homework 4: 謎



size 225 225
paper 30 15 10
command square x y s c
{

pen c x s
line c s c(c+s)


pen c x s
line c x s (c+s)

}

repeat A 3 11
{
repeat B 0 40
{
square (A*10+3) (B*10+5) 0 (A+B*10)
}
}

Homework 5: 酸甜梅子奶



size 300 300

paper 90 60 80

forever

{

Set S (S*20)

repeat a 100 0

{

pen (5*(a)) (3*a) (10*a)

line 300 (a*10) (s-30) 0

pen ((a)) (2*a) (3*a)

line 0 (s-50) (a*10) 300

}

}


Homework 3: 圓角不融


load dbngraphics.dbn

size 350 350

paper 30 15 10

repeat c 0 175

{

pen 100 60 20

triangle 0 0 (c*2) 350 0 175

}

repeat c 0 175

{

pen 50 60 20

triangle 350 350 (c*5) 350 350 0

}

fast

repeat c 0 70

{

pen 100 100 100

triangle 175 175 (c*5) 0 350 0

}

fast

circle 175 350 175 0

circle 175 350 170 0

circle 175 350 169 0

circle 175 350 168 0

circle 175 350 167 0

circle 175 350 166 0

circle 175 350 165 0

circle 175 350 164 0

circle 175 350 163 0

circle 175 350 162 0

circle 175 350 161 0

circle 175 350 160 0

circle 175 350 155 0

circle 175 350 154 0

circle 175 350 153 0

circle 175 350 152 0

circle 175 350 151 0

circle 175 350 150 0

circle 175 350 145 0

circle 175 350 146 0

circle 175 350 147 0

circle 175 350 148 0

circle 175 350 125 0

circle 175 350 126 0

circle 175 350 127 0

circle 175 350 128 0

circle 175 350 129 0

circle 175 350 130 0

circle 175 350 131 0

circle 175 350 136 0

circle 175 350 138 0

circle 175 350 140 0

circle 175 350 144 0

circle 175 350 146 0

circle 175 350 148 0

circle 175 350 150 0

circle 175 350 100 0

circle 175 350 102 0

circle 175 350 104 0

circle 175 350 106 0

circle 175 350 108 0

circle 175 350 110 0

circle 175 350 112 0

circle 175 350 114 0

circle 175 350 116 0

circle 175 350 118 0

circle 175 350 120 0

circle 175 350 122 0

circle 175 350 124 0

circle 175 350 126 0

circle 175 350 128 0

circle 175 350 115 0

circle 175 350 114 0

circle 175 350 113 0

circle 175 350 112 0

circle 175 350 111 0

circle 175 350 110 0

circle 175 350 109 0

circle 175 350 108 0

circle 175 350 107 0

circle 175 350 106 0

circle 175 350 105 0

circle 175 350 104 0

circle 175 350 103 0

circle 175 350 102 0

circle 175 350 101 0

circle 175 350 100 0

circle 175 350 75 0

circle 175 350 74 0

circle 175 350 73 0

circle 175 350 72 0

circle 175 350 71 0

circle 175 350 70 0

circle 175 350 77 0

circle 175 350 79 0

circle 175 350 81 0

circle 175 350 83 0

circle 175 350 86 0

circle 175 350 50 0

circle 175 350 52 0

circle 175 350 53 0

circle 175 350 55 0

circle 175 350 57 0

circle 175 350 58 0

circle 175 350 59 0

circle 175 350 63 0

circle 175 350 55 0

circle 175 350 54 0

circle 175 350 53 0

circle 175 350 52 0

circle 175 350 51 0

circle 175 350 58 0

circle 175 350 60 0

circle 175 350 66 0

circle 175 350 44 0

circle 175 350 40 0

circle 175 350 39 0

circle 175 350 38 0

circle 175 350 37 0

circle 175 350 36 0

circle 175 350 35 0

circle 175 350 34 0

circle 175 350 33 0

circle 175 350 32 0

2009年11月5日 星期四

期中數位康丁斯基



load dbngraphics.dbn
size 430 340
paper 61 75 60

//三下三角
repeat s 0 50
{
pen 100triangle 200 35 220 (35+s) 240 35
}
//三中三角
repeat s 0 50
{
pen 100
triangle 195 85 220 (85+s) 245 85
}
//三上三角
repeat s 0 50
{
pen 100
triangle 190 135 220 (135+s) 250 135
}
//橘三角
repeat s 200 0
{
pen 100 (s-100) 0
triangle 170 125 95 (125+s) 175 125
}
//fast
//白長方pen 0
repeat a 0 9
{
line 25 (150+a) 95 (150+a)
}
//黑三角
repeat s 0 25
{
pen 100
triangle 35 138 50 (138-s) 63 138
}
//三角紅
repeat s 0 10
{
pen 100 0 0
triangle 95 135 75 135 95 (135-s)
}
//三角黃
repeat s 0 10
{
pen 100 100 0
triangle 95 145 70 145 95 (145-s)
}
//橘三角
repeat s 70 0
{
pen 100 s 0
triangle 20 113 90 (113-s) 150 113
}
//正下三角
repeat s 0 60
{
pen 20 60 40
triangle 95 175 95 225 (35+s) 175
}
//正上三角
repeat s 0 50
{
pen 80 20 10
triangle 95 225 35 175 35 (175+s)
}
//fast
//正方形
repeat s 25 0
{
pen 100 0 0line (215-s) (245+s) (190-s) (220+s)
}
//小Circle
repeat c 0 25
{
circle 325 180 c 100
}
fast
//中Circle
repeat c 0 50
{
circle 325 180 (c+25) c
}
//大Circle
repeat c 0 8
{
circle 325 180 (c+75) 100
}

//右黃槓
pen 100 100 40
repeat a 0 9
{
line 340 (325-a) 400 (325-a)
}
//上三角
repeat s 0 100
{
pen 80 (s-70) 0
triangle 380 280 325 (280-s) 250 280
}
//下三角
repeat s 0 150
{
pen 400 (s-50) 0
triangle 280 25 325 (25+s) 365 25
}

2009年10月15日 星期四

Homework 2: 咖啡來一杯


paper 20 0 0
size 300 300 2

repeat A 0 25
{
pen 50 20 0
line (25+A) 0 (25+A) 300
line (250+A) 0 (250+A) 300
line 0 (25+A) 300 (25+A)
line 0 (250+A) 300 (250+A)
}

repeat B 0 25
{
pen 20 0 0
line 25 (250+B) 50 (250+B)
line 25 (25+B) 50 (25+B)
line 250 (250+B) 275 (250+B)
line 250 (25+B) 275 (25+B)
}

repeat C 0 8
{
pen 55 30 5
line (96+C) 0 (96+C) 300
line (146+C) 0 (146+C) 300
line (196+C) 0 (196+C) 300
line 0 (196+C) 300 (196+C)
line 0 (146+C) 3000 (146+C)
line 0 (96+C) 300 (96+C)
}

repeat D 0 2
{
pen 100 60 20
line 0 (80+D) 300 (80+D)
line 0 (64+D) 300 (64+D)
line 0 (218+D) 300 (218+D)
line 0 (234+D) 300 (234+D)
line (80+D) 0 (80+D) 300
line (64+D) 0 (64+D) 300
line (218+D) 0 (218+D) 300
line (234+D) 0 (234+D) 300
}

repeat E 0 1
{
pen 70 30 0
line 0 (280+E) 300 (280+E)
line 0 (20+E) 300 (20+E)
line (280+E) 0 (280+E) 300
line (20+E) 0 (20+E) 300
}

2009年10月1日 星期四

Homework 1: name

size 500 400
paper 30 15 10
pen 50 60 20
line 0 350 500 350
pen 100 60 20
line 125 400 125 275
pen 100 60 20
line 375 400 375 275
pen 100 60 20
line 100 350 100 275
pen 100 60 20
line 150 350 150 275
pen 100 60 20
line 350 350 350 275
pen 100 60 20
line 400 350 400 275
pen 50 60 20
line 0 275 500 275
pen 100 60 20
line 50 275 50 175
pen 100 60 20
line 200 275 200 175
pen 50 60 20
line 0 175 500 175
pen 100 60 20
line 325 275 325 175
pen 100 60 20
line 450 275 450 175
pen 50 60 20
line 325 250 250 250
pen 50 60 20
line 325 200 250 200
pen 50 60 20
line 450 250 375 250
pen 50 60 20
line 450 200 375 200
pen 100 60 20
line 50 175 50 50
pen 50 60 20
line 50 50 200 50
pen 100 60 20
line 175 175 175 25
pen 50 60 20
line 25 150 200 150
pen 50 60 20
line 225 150 475 150
pen 100 60 20
line 225 125 475 125
pen 100 60 20
line 225 125 225 75
pen 100 60 20
line 225 75 475 75
pen 100 60 20
line 475 125 475 75
pen 100 60 20
line 200 50 200 75
pen 50 60 20
line 200 75 500 75
pen 100 60 20
line 500 75 500 50
pen 50 60 20
line 225 50 475 50
pen 100 60 20
line 350 50 350 0
pen 100 60 20
line 250 0 250 25