标签:gif 坐标 国际象棋 eve 国际 tle event black lse
1.五角星
import turtle turtle.pensize(5) turtle.pencolor("yellow") turtle.left(72) turtle.fillcolor("red") turtle.begin_fill() for _ in range(5): turtle.fd(120) turtle.right(144) turtle.fd(120) turtle.left(72) turtle.end_fill()
2.同心圆
import turtle r = eval(input()) m = eval(input()) y = input() i = 0 turtle.pensize(5) turtle.pencolor(y) turtle.begin_fill() for _ in range(m): turtle.circle(r) r = r+20 i = i+20 turtle.penup() turtle.goto(0,-i) turtle.pendown()
3.渐变圆
import turtle n = eval(input()) m = 2 turtle.pensize(3) turtle.pencolor("blue") turtle.fillcolor("yellow") turtle.penup() turtle.forward(-350) turtle.pendown() turtle.begin_fill() for _ in range(n-2): m = m+1 turtle.circle(25,steps=m) turtle.forward(70) turtle.circle(25) turtle.end_fill()
4.五环
import turtle turtle.pensize(5) color=("red","blue","green","yellow","black") i=0 coordA=(-110,0,110,-55,55) #五个图起点坐标的x值 coordB=(-25,-25,-25,-75,-75) #五个圆起点坐标的y值 turtle.begin_fill() for _ in range(5): turtle.penup() turtle.goto(coordA[i],coordB[i]) turtle.color(color[i]) i = i+1 turtle.pendown() turtle.circle(45)
5.太极
import turtle turtle.pensize(3) turtle.pencolor("black") turtle.begin_fill() turtle.penup() turtle.goto(0,-300) turtle.pendown() turtle.circle(230,180) turtle.fillcolor("black") turtle.end_fill() turtle.begin_fill() turtle.penup() turtle.goto(0,160) turtle.pendown() turtle.circle(230,180) turtle.fillcolor("white") turtle.end_fill() turtle.begin_fill() turtle.circle(115,-180) turtle.fillcolor("black") turtle.end_fill() turtle.begin_fill() turtle.circle(-115,-180) turtle.fillcolor("white") turtle.end_fill() turtle.begin_fill() turtle.penup() turtle.goto(0,0) turtle.pendown() turtle.circle(30) turtle.fillcolor("black") turtle.end_fill() turtle.begin_fill() turtle.penup() turtle.goto(0,-200) turtle.pendown() turtle.circle(30) turtle.fillcolor("white") turtle.end_fill()
6.国际象棋盘
import turtle t = 0 n = eval(input()) turtle.pensize(3) turtle.pencolor("black") for _ in range(8): if t % 2 == 0: turtle.penup() i = 1 turtle.goto(n*t,-n) turtle.pendown() turtle.begin_fill() for _ in range(4): for _ in range(4): turtle.forward(n) turtle.right(90) turtle.fillcolor("black") turtle.penup() i = i+2 turtle.goto(n*t,-n*i) turtle.pendown() turtle.end_fill() t = t+1 else: turtle.penup() i = 0 turtle.goto(n*t,0) turtle.pendown() for _ in range(4): turtle.begin_fill() for _ in range(4): turtle.forward(n) turtle.fillcolor("black") turtle.right(90) turtle.penup() i = i+1 turtle.goto(n*t,-n*2*i) turtle.pendown() turtle.end_fill() turtle.penup() turtle.goto(n*t,0) turtle.pendown() t = t+1 turtle.penup() turtle.goto(0,0) turtle.pendown() for _ in range(4): turtle.forward(n*8) turtle.right(90)
标签:gif 坐标 国际象棋 eve 国际 tle event black lse
原文地址:https://www.cnblogs.com/ikome/p/12494364.html