就差货啦,希望各位支持!!
1 #自动售货机 2 import turtle 3 turtle.pensize(3) 4 #阴影 5 turtle.color("lightgray","gray") 6 turtle.penup() 7 turtle.goto(-105,-170) 8 turtle.pendown() 9 turtle.begin_fill() 10 turtle.right(160) 11 turtle.forward(10) 12 turtle.circle(5,160) 13 turtle.forward(300) 14 turtle.circle(5,20) 15 turtle.forward(100) 16 turtle.circle(5,160) 17 turtle.forward(300) 18 turtle.circle(5,20) 19 turtle.forward(90) 20 turtle.left(160) 21 turtle.end_fill() 22 #正面 23 turtle.color("coral","salmon") 24 turtle.penup() 25 turtle.goto(-105,170) 26 turtle.pendown() 27 turtle.left(90) 28 turtle.begin_fill() 29 turtle.circle(-5,90) 30 turtle.forward(200) 31 turtle.circle(-5,90) 32 turtle.forward(340) 33 turtle.circle(-5,90) 34 turtle.forward(200) 35 turtle.circle(-5,90) 36 turtle.forward(340) 37 turtle.end_fill() 38 #顶部 39 turtle.color("coral","firebrick") 40 turtle.circle(-5,90) 41 turtle.left(20) 42 turtle.begin_fill() 43 turtle.forward(75) 44 turtle.right(20) 45 turtle.forward(200) 46 turtle.right(160) 47 turtle.forward(75) 48 turtle.right(20) 49 turtle.forward(200) 50 turtle.end_fill() 51 #侧面 52 turtle.color("coral","brown") 53 turtle.penup() 54 turtle.goto(100,175) 55 turtle.pendown() 56 turtle.begin_fill() 57 turtle.right(180) 58 turtle.circle(-5,90) 59 turtle.forward(340) 60 turtle.circle(-5,90) 61 turtle.right(160) 62 turtle.forward(75) 63 turtle.circle(5,70) 64 turtle.forward(340) 65 turtle.circle(5,110) 66 turtle.forward(75) 67 turtle.end_fill() 68 #窗口 69 turtle.color("maroon","mistyrose") 70 turtle.penup() 71 turtle.goto(-100,165) 72 turtle.pendown() 73 turtle.begin_fill() 74 turtle.left(160) 75 turtle.forward(150) 76 turtle.right(90) 77 turtle.forward(220) 78 turtle.right(90) 79 turtle.forward(150) 80 turtle.right(90) 81 turtle.forward(220) 82 turtle.end_fill() 83 #投币口 84 turtle.pencolor("maroon") 85 turtle.penup() 86 turtle.goto(100,165) 87 turtle.pendown() 88 turtle.backward(330) 89 turtle.left(90) 90 turtle.forward(45) 91 turtle.right(90) 92 turtle.forward(330) 93 turtle.right(90) 94 turtle.forward(45) 95 #拿货口 96 turtle.penup() 97 turtle.goto(-80,-80) 98 turtle.pendown() 99 turtle.forward(110) 100 turtle.right(90) 101 turtle.forward(60) 102 turtle.right(90) 103 turtle.forward(110) 104 turtle.right(90) 105 turtle.forward(60) 106 turtle.backward(57) 107 turtle.right(90) 108 turtle.forward(3) 109 turtle.pencolor("mistyrose") 110 turtle.forward(104) 111 #字母P 112 turtle.penup() 113 turtle.goto(-63,-95) 114 turtle.pendown() 115 turtle.forward(10) 116 turtle.circle(-5,180) 117 turtle.forward(10) 118 turtle.right(90) 119 turtle.forward(10) 120 turtle.backward(20) 121 #字母U 122 turtle.penup() 123 turtle.goto(-43,-95) 124 turtle.pendown() 125 turtle.backward(15) 126 turtle.right(180) 127 turtle.circle(7,180) 128 turtle.forward(15) 129 #字母S 130 turtle.penup() 131 turtle.goto(-8,-100) 132 turtle.pendown() 133 turtle.circle(5,90) 134 turtle.forward(5) 135 turtle.circle(5,180) 136 turtle.forward(5) 137 turtle.circle(-5,180) 138 turtle.forward(5) 139 turtle.circle(-5,90) 140 #字母H 141 turtle.penup() 142 turtle.goto(-3,-95) 143 turtle.pendown() 144 turtle.backward(20) 145 turtle.forward(10) 146 turtle.right(90) 147 turtle.forward(15) 148 turtle.right(90) 149 turtle.forward(10) 150 turtle.backward(20) 151 152 turtle.pensize(1) 153 turtle.color("maroon","maroon") 154 turtle.penup() 155 turtle.goto(-100,125) 156 turtle.pendown() 157 turtle.begin_fill() 158 turtle.left(90) 159 turtle.forward(150) 160 turtle.right(90) 161 turtle.forward(5) 162 turtle.right(90) 163 turtle.forward(150) 164 turtle.right(90) 165 turtle.forward(5) 166 turtle.end_fill() 167 168 turtle.penup() 169 turtle.goto(-100,80) 170 turtle.pendown() 171 turtle.begin_fill() 172 turtle.right(90) 173 turtle.forward(150) 174 turtle.right(90) 175 turtle.forward(5) 176 turtle.right(90) 177 turtle.forward(150) 178 turtle.right(90) 179 turtle.forward(5) 180 turtle.end_fill() 181 182 turtle.penup() 183 turtle.goto(-100,35) 184 turtle.pendown() 185 turtle.begin_fill() 186 turtle.right(90) 187 turtle.forward(150) 188 turtle.right(90) 189 turtle.forward(5) 190 turtle.right(90) 191 turtle.forward(150) 192 turtle.right(90) 193 turtle.forward(5) 194 turtle.end_fill() 195 196 turtle.penup() 197 turtle.goto(-100,-10) 198 turtle.pendown() 199 turtle.begin_fill() 200 turtle.right(90) 201 turtle.forward(150) 202 turtle.right(90) 203 turtle.forward(5) 204 turtle.right(90) 205 turtle.forward(150) 206 turtle.right(90) 207 turtle.forward(5) 208 turtle.end_fill() 209 210 turtle.penup() 211 turtle.goto(-100,125) 212 turtle.pendown() 213 turtle.right(70) 214 turtle.forward(70) 215 turtle.left(70) 216 turtle.forward(15) 217 turtle.backward(15) 218 turtle.right(90) 219 turtle.forward(85) 220 221 turtle.penup() 222 turtle.goto(-100,80) 223 turtle.pendown() 224 turtle.left(20) 225 turtle.forward(70) 226 turtle.left(70) 227 turtle.forward(15) 228 turtle.backward(15) 229 turtle.right(90) 230 turtle.forward(85) 231 232 turtle.penup() 233 turtle.goto(-100,35) 234 turtle.pendown() 235 turtle.left(20) 236 turtle.forward(70) 237 turtle.left(70) 238 turtle.forward(15) 239 turtle.backward(15) 240 turtle.right(90) 241 turtle.forward(85) 242 243 turtle.penup() 244 turtle.goto(-100,-10) 245 turtle.pendown() 246 turtle.left(20) 247 turtle.forward(70) 248 turtle.left(70) 249 turtle.forward(15) 250 turtle.backward(15) 251 turtle.right(90) 252 turtle.forward(85) 253 254 turtle.penup() 255 turtle.goto(-100,-55) 256 turtle.pendown() 257 turtle.left(20) 258 turtle.forward(70) 259 turtle.left(70) 260 turtle.forward(15) 261 turtle.backward(15) 262 turtle.right(90) 263 turtle.forward(85) 264 265 turtle.color("maroon","mistyrose") 266 turtle.penup() 267 turtle.goto(94,155) 268 turtle.pendown() 269 turtle.begin_fill() 270 turtle.backward(33) 271 turtle.right(90) 272 turtle.forward(8) 273 turtle.left(90) 274 turtle.forward(33) 275 turtle.left(90) 276 turtle.forward(8) 277 turtle.end_fill() 278 279 turtle.color("maroon","maroon") 280 turtle.penup() 281 turtle.goto(93,135) 282 turtle.pendown() 283 turtle.begin_fill() 284 turtle.backward(10) 285 turtle.left(90) 286 turtle.forward(30) 287 turtle.right(90) 288 turtle.forward(10) 289 turtle.right(90) 290 turtle.forward(30) 291 turtle.end_fill() 292 293 turtle.color("maroon","mistyrose") 294 turtle.penup() 295 turtle.goto(93,100) 296 turtle.pendown() 297 turtle.begin_fill() 298 turtle.backward(30) 299 turtle.right(90) 300 turtle.forward(40) 301 turtle.left(90) 302 turtle.forward(30) 303 turtle.left(90) 304 turtle.forward(40) 305 turtle.end_fill() 306 307 turtle.left(90) 308 turtle.forward(10) 309 turtle.left(90) 310 turtle.forward(40) 311 turtle.right(90) 312 turtle.forward(10) 313 turtle.right(90) 314 turtle.forward(40) 315 turtle.left(90) 316 turtle.forward(10) 317 turtle.left(90) 318 turtle.forward(10) 319 turtle.left(90) 320 turtle.forward(30) 321 turtle.right(90) 322 turtle.forward(10) 323 turtle.right(90) 324 turtle.forward(30) 325 turtle.left(90) 326 turtle.forward(10) 327 turtle.left(90) 328 turtle.forward(30) 329 turtle.right(90) 330 turtle.forward(10) 331 turtle.right(90) 332 turtle.forward(30) 333 334 turtle.color("maroon","maroon") 335 turtle.begin_fill() 336 turtle.right(90) 337 turtle.forward(10) 338 turtle.right(90) 339 turtle.forward(10) 340 turtle.right(90) 341 turtle.forward(10) 342 turtle.right(90) 343 turtle.forward(10) 344 turtle.end_fill() 345 346 turtle.right(90) 347 turtle.forward(10) 348 turtle.right(90) 349 turtle.forward(30) 350 turtle.begin_fill() 351 turtle.right(90) 352 turtle.forward(10) 353 turtle.right(90) 354 turtle.forward(10) 355 turtle.right(90) 356 turtle.forward(10) 357 turtle.right(90) 358 turtle.forward(10) 359 turtle.end_fill() 360 361 turtle.color("maroon","mistyrose") 362 turtle.penup() 363 turtle.goto(88,40) 364 turtle.pendown() 365 turtle.begin_fill() 366 turtle.backward(20) 367 turtle.right(90) 368 turtle.forward(15) 369 turtle.left(90) 370 turtle.forward(20) 371 turtle.left(90) 372 turtle.forward(15) 373 turtle.end_fill() 374 375 turtle.color("maroon","maroon") 376 turtle.penup() 377 turtle.goto(85,30) 378 turtle.pendown() 379 turtle.begin_fill() 380 turtle.backward(3) 381 turtle.left(90) 382 turtle.forward(14) 383 turtle.right(90) 384 turtle.forward(3) 385 turtle.right(90) 386 turtle.forward(14) 387 turtle.end_fill() 388 389 turtle.color("maroon","mistyrose") 390 turtle.penup() 391 turtle.goto(88,-100) 392 turtle.pendown() 393 turtle.begin_fill() 394 turtle.backward(20) 395 turtle.right(90) 396 turtle.forward(15) 397 turtle.left(90) 398 turtle.forward(20) 399 turtle.left(90) 400 turtle.forward(15) 401 turtle.end_fill() 402 403 turtle.color("maroon","maroon") 404 turtle.penup() 405 turtle.goto(85,-105) 406 turtle.pendown() 407 turtle.begin_fill() 408 turtle.backward(5) 409 turtle.left(90) 410 turtle.forward(14) 411 turtle.right(90) 412 turtle.forward(5) 413 turtle.right(90) 414 turtle.forward(14) 415 turtle.end_fill() 416 417 turtle.hideturtle()