python用turtle库绘制树图形_大家用Python-turtle库作图画出过哪些漂亮的树哇 ?

画过一个国旗:

不过是用cad辅助坐标画出来的,各种goto哈哈,没啥技术含量,单纯图一乐。

代码(70行):

import turtle as t

t.setup(1000,800)

t.hideturtle()

t.speed(1)

t.begin_fill()

t.color('red','red')

t.fd(288)

t.left(90)

t.fd(192)

t.left(90)

t.fd(288)

t.left(90)

t.fd(192)

t.end_fill()

t.pu()

t.goto(31.07,120.7)

t.pd()

t.begin_fill()

t.color('yellow','yellow')

t.left(126)

t.fd(54.78)

for (i) in range(4):

t.left(144)

t.fd(54.78)

t.end_fill()

t.begin_fill()

t.color('yellow','yellow')

t.pu()

t.goto(87.78,167.87)

t.pd()

t.left(121)

t.fd(18.26)

for (i) in range(4):

t.left(144)

t.fd(18.26)

t.end_fill()

t.begin_fill()

t.color('yellow','yellow')

t.pu()

t.goto(105.69,152.26)

t.pd()

t.left(121)

t.fd(18.26)

for (i) in range(4):

t.left(144)

t.fd(18.26)

t.end_fill()

t.begin_fill()

t.color('yellow','yellow')

t.pu()

t.goto(105.97,127.45)

t.pd()

t.seth(-36)

t.fd(18.26)

for (i) in range(4):

t.left(144)

t.fd(18.26)

t.end_fill()

t.begin_fill()

t.color('yellow','yellow')

t.pu()

t.goto(88.54,111.64)

t.pd()

t.seth(-57)

t.fd(18.26)

for (i) in range(4):

t.left(144)

t.fd(18.26)

t.end_fill()

t.done()

//兄弟们 手下留赞

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值