代码拉取完成,页面将自动刷新
# This is a custom module we've made.
# Modules are files full of code that you can import into your programs.
# This one teaches our turtle to draw various shapes.
import turtle
import math
def draw_circle(turtle, color, x, y, radius):
turtle.penup()
turtle.color(color)
turtle.fillcolor(color)
turtle.goto(x, y)
turtle.pendown()
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
def draw_rectangle(turtle, color, x, y, width, height):
turtle.hideturtle()
turtle.penup()
turtle.color(color)
turtle.fillcolor(color)
turtle.goto(x, y)
turtle.pendown()
turtle.begin_fill()
for i in range(2):
turtle.forward(width)
turtle.left(90)
turtle.forward(height)
turtle.left(90)
turtle.end_fill()
turtle.setheading(0)
def draw_star(turtle, color, x, y, size):
turtle.penup()
turtle.color(color)
turtle.fillcolor(color)
turtle.goto(x, y)
turtle.pendown()
turtle.begin_fill()
turtle.right(144)
for i in range(5):
turtle.forward(size)
turtle.right(144)
turtle.forward(size)
turtle.end_fill()
turtle.setheading(0)
def addIcing(turtle, color, x, y):
turtle.penup()
turtle.color(color)
turtle.fillcolor(color)
turtle.goto(-x - 2, y + 10)
turtle.pendown()
turtle.begin_fill()
for z in range(-x - 3, x + 3):
turtle.goto(z, y - 10 - 10 * math.cos((z / 100) * 2 * math.pi))
turtle.goto(x + 3, y + 10)
turtle.goto(-x - 3, y + 10)
turtle.end_fill()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。