找回密码
 中文实名注册
查看: 377|回复: 4

太极图(完整版)

[复制链接]

18

主题

83

帖子

1813

积分

金牌会员

Rank: 6Rank: 6

积分
1813
发表于 2022-3-19 18:57:11 | 显示全部楼层 |阅读模式
本帖最后由 王彦博 于 2022-7-30 17:18 编辑

[Python] 纯文本查看 复制代码
import turtle

turtle.title("太极图")

turtle.screensize(bg='black')

turtle.speed(0)

turtle.pensize(2)

turtle.fillcolor('yellow')

turtle.begin_fill()

turtle.penup()

turtle.goto(-150, -150)

turtle.pendown()

for r in range(4):

    turtle.forward(300)

    turtle.left(90)

turtle.end_fill()

turtle.penup()

turtle.goto(00, -100)

turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(100, 180)
turtle.circle(50, -180)
turtle.circle(-50, -180)
turtle.end_fill()

turtle.pendown()
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(-50, 180)
turtle.circle(50, 180)
turtle.circle(100, 180)
turtle.end_fill()
turtle.penup()
turtle.goto(0, 50)
turtle.pencolor('white')
turtle.dot(30)

turtle.goto(0, -50)
turtle.pencolor('black')
turtle.dot(30)
turtle.done()

点评

做得不错,太极两个点的用dot命令,用circle偏上了。回作业的地方也错了,请修改后回复到题目的下面。请使用<>代码功能回复,其他题目也请做一下   发表于 2022-3-20 09:04
回复

使用道具 举报

18

主题

83

帖子

1813

积分

金牌会员

Rank: 6Rank: 6

积分
1813
 楼主| 发表于 2022-3-19 18:57:49 | 显示全部楼层
import turtle

turtle.title("太极图")

turtle.screensize(bg='black')

turtle.speed(0)

turtle.pensize(2)

turtle.fillcolor('yellow')

turtle.begin_fill()

turtle.penup()

turtle.goto(-150, -150)

turtle.pendown()

for r in range(4):

    turtle.forward(300)

    turtle.left(90)

turtle.end_fill()

turtle.penup()

turtle.goto(00, -100)

turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(100,180)
turtle.circle(50, -180)
turtle.circle(-50,-180)
turtle.end_fill()

turtle.pendown()
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(-50,180)
turtle.circle(50,180)
turtle.circle(100,180)
turtle.end_fill()
turtle.penup()
turtle.goto(0,50)
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(10,360)
turtle.end_fill()

turtle.goto(0, -50)
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(10, 360)
turtle.end_fill()
turtle.done()
回复

使用道具 举报

2

主题

50

帖子

1036

积分

金牌会员

Rank: 6Rank: 6

积分
1036
发表于 2022-3-27 12:56:35 | 显示全部楼层
import turtle

turtle.title("太极图")
turtle.screensize(bg='black')
turtle.speed(0)
turtle.pensize(2)
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.penup()
turtle.goto(-150, -150)
turtle.pendown()
for r in range(4):
    turtle.forward(300)
    turtle.left(90)
turtle.end_fill()
turtle.penup()
turtle.goto(00, -100)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(100, 180)
turtle.circle(50, -180)
turtle.circle(-50, -180)
turtle.end_fill()
turtle.pendown()
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(-50, 180)
turtle.circle(50, 180)
turtle.circle(100, 180)
turtle.end_fill()
turtle.penup()
turtle.goto(0, 50)
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(10, 360)
turtle.end_fill()
turtle.goto(0, -50)
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(10, 360)
turtle.end_fill()

turtle.done()



回复

使用道具 举报

2

主题

110

帖子

1519

积分

金牌会员

Rank: 6Rank: 6

积分
1519
QQ
发表于 2022-4-17 17:37:54 | 显示全部楼层
[Python] 纯文本查看 复制代码
import turtle

 turtle.title('太极图')
turtle.screensize(bg='black')

 turtle.speed(0)

 turtle.pensize(2)

 turtle.fillcolor('yellow')

 turtle.begin_fill()

 turtle.penup()

 turtle.goto(-150, -150)

 turtle.pendown()
 for i in range(4):
     turtle.forward(300)
     turtle.left(90)
 turtle.end_fill()

 turtle.penup()

 turtle.goto(0, -100)

 turtle.pendown()
 turtle.fillcolor('white')
 turtle.begin_fill()
 turtle.circle(100,180)
 turtle.circle(50, -180)
 turtle.circle(-50,-180)
 turtle.end_fill()

 turtle.pendown()
 turtle.fillcolor('black')
 turtle.begin_fill()
 turtle.circle(-50,180)
 turtle.circle(50,180)
 turtle.circle(100,180)
 turtle.end_fill()
 turtle.penup()
 turtle.goto(0,50)
 turtle.fillcolor('white')
 turtle.begin_fill()
 turtle.circle(10,360)
 turtle.end_fill()

 turtle.goto(0, -50)
 turtle.fillcolor('black')
 turtle.begin_fill()
 turtle.circle(10, 360)
 turtle.end_fill()

 turtle.done()
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 中文实名注册

本版积分规则

小黑屋|东台市机器人学会 ( 苏ICP备2021035350号-1;苏ICP备2021035350号-2;苏ICP备2021035350号-3 )

GMT+8, 2024-5-17 16:57 , Processed in 0.045321 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表